gE Perfect Textbox [Developement Issues & discussion]

Talk about making games.

Re: gE Perfect Textbox [Developement Issues & discussion]

Postby lcl » Wed Mar 26, 2014 1:06 am

bat78 wrote:No doubts! I am just not used to them.. still making mistakes like the one you got me in :oops:
*figuring out how and where the struct will work in my code*

Haha, but you know, I did that very same mistake when I first started using typedef structs. :P
It might be confusing at first, but it's easy to get the hang of it quite quickly.
For me, it really helped to think a struct as an object like GE's actors. And it's pretty much true, since GE's actors
are structs :D
User avatar
lcl
 
Posts: 2339
Joined: Thu Mar 25, 2010 5:55 pm
Location: Finland
Score: 276 Give a positive score

Re: gE Perfect Textbox [Developement Issues & discussion]

Postby bat78 » Wed Mar 26, 2014 1:11 am

lcl wrote:
bat78 wrote:No doubts! I am just not used to them.. still making mistakes like the one you got me in :oops:
*figuring out how and where the struct will work in my code*

Haha, but you know, I did that very same mistake when I first started using typedef structs. :P
It might be confusing at first, but it's easy to get the hang of it quite quickly.
For me, it really helped to think a struct as an object like GE's actors. And it's pretty much true, since GE's actors
are structs :D


Yep, they access members such as x, y, width, animpos etc...
But in my code, using structs.. somehow i get printed only one character.
Its just i still need to use static structure var.

getbox3.zip
(487.65 KiB) Downloaded 117 times
The future of "Game-Editor" here
User avatar
bat78
 
Posts: 816
Joined: Sun Dec 14, 2008 9:13 pm
Location: Bulgaria, Sofia
Score: 88 Give a positive score

Re: gE Perfect Textbox [Developement Issues & discussion]

Postby lcl » Wed Mar 26, 2014 1:25 am

bat78 wrote:But in my code, using structs.. somehow i get printed only one character.
Its just i still need to use static structure var.

getbox3.zip

Do you actually need to have the struct not be global?
It would be really simple if you just used global structs for this.
Kind of like in my text input thingy :mrgreen:

But if you are not willing to use Global structs, then I don't think structs are an answer for the static text string problem.
What I'd suggest is to use the font actors to store the string whenever their own text box is inactive. This way the static string variable could always have the string
of the currently active text box, and the other boxes' strings would be safely stored elsewhere. You should of course copy the text from the font actor to the static string whenever you activate
a previously inactive text box. :)
User avatar
lcl
 
Posts: 2339
Joined: Thu Mar 25, 2010 5:55 pm
Location: Finland
Score: 276 Give a positive score

Re: gE Perfect Textbox [Developement Issues & discussion]

Postby bat78 » Wed Mar 26, 2014 1:41 am

lcl wrote:
bat78 wrote:But in my code, using structs.. somehow i get printed only one character.
Its just i still need to use static structure var.

getbox3.zip

Do you actually need to have the struct not be global?
It would be really simple if you just used global structs for this.
Kind of like in my text input thingy :mrgreen:

But if you are not willing to use Global structs, then I don't think structs are an answer for the static text string problem.
What I'd suggest is to use the font actors to store the string whenever their own text box is inactive. This way the static string variable could always have the string
of the currently active text box, and the other boxes' strings would be safely stored elsewhere. You should of course copy the text from the font actor to the static string whenever you activate
a previously inactive text box. :)

But if i use them globally it won't work individually like we want :s
I need to do whatever you said about the static char xD
The future of "Game-Editor" here
User avatar
bat78
 
Posts: 816
Joined: Sun Dec 14, 2008 9:13 pm
Location: Bulgaria, Sofia
Score: 88 Give a positive score

Re: gE Perfect Textbox [Developement Issues & discussion]

Postby lcl » Wed Mar 26, 2014 1:49 am

bat78 wrote:But if i use them globally it won't work individually like we want :s

I don't quite understand what you mean..?
You can just make a global array of structs, and then use those structs.
It's not all so different from how you managed your text boxes' active/inactive setting - through a global array.

Anyway, I got to go to sleep, it's very late here.. zzzzz
User avatar
lcl
 
Posts: 2339
Joined: Thu Mar 25, 2010 5:55 pm
Location: Finland
Score: 276 Give a positive score

Re: gE Perfect Textbox [Developement Issues & discussion]

Postby bat78 » Wed Mar 26, 2014 1:57 am

Yeah i am sleepy too. Indeed. I can't understand myself as well.
Good Night from me and i thanks :)
The future of "Game-Editor" here
User avatar
bat78
 
Posts: 816
Joined: Sun Dec 14, 2008 9:13 pm
Location: Bulgaria, Sofia
Score: 88 Give a positive score

Previous

Return to Game Development

Who is online

Users browsing this forum: Google [Bot] and 1 guest

cron