Gui wont show up.

Started by Estaog, Sat 19/03/2005 22:37:28

Previous topic - Next topic

Estaog

I feel kinda stupid for asking this, but the gui wont show up:



Now "persistent" should mean it will me be there from the beginning, but it just wont show up. The other gui shows up no problem. Is there something I forgot to do?
Think about the kittens man!

http://members.aol.com/johnk0/godkills.jpg

DoorKnobHandle

It is showing up - but off-screen... That means, that your x and y coordinates are so high, the gui is outside the screen.

You have to use coordinates from 0 to 320 for x and from 0 to 200 for y, whatever your resolution is! The point ( 0, 200 ) for example is always the left lower corner...

Estaog

Ahh thanks forgot that, Now that this is solved, i have another problem, how do i tell it to show a variable (instead of the "@error@")?
Think about the kittens man!

http://members.aol.com/johnk0/godkills.jpg

DoorKnobHandle

double post ;)

now that is somewhat advanced...

here we go:

- you create a 'gui label' element on your gui.
- you select it and memorize it's id number (you can see it in the object properties window title!). Let's assume it is object 4 for this example...
- now you go in your script.
- and into your repeatedly execute function...
- there you add this somewhere between the brackets:

Code: ags

function repeatedly_execute ( )
{
   // somewhere in this function add this line
   SetLabelText ( 1 , 4, var );
]


This sets the label number 4 on GUI number 1 to the string variable 'var' every game cycle...

Ask if you need further help!


Estaog

Wait, those it have to be a string, or can I use an integer? Because strings cannot be imported into rooms and such, which is what I want.
Think about the kittens man!

http://members.aol.com/johnk0/godkills.jpg

DoorKnobHandle

If you want to display an integer value, you will have to convert it!

Code: ags

string buffer;
StrFormat ( buffer, "%d", var );
SetLabelText ( 1,  4, buffer );


This piece creates a string variable named 'buffer', then it fills 'buffer' with the content from your int variable 'var' and then it prints it out on GUI 1, object 4...

Is that what you needed?

Estaog

Yep, works fine now.

Another problem: The test game function doesn't seem to work properly with my new computer. About 1/4 times I run it acts all weird. Like for when I quit it a small white window appears in the corner, like the game didn't exit properly, and then I have to use the "end now" function. Also sometimes it gives me an error that the engine didn't close properly, and that I should write here if the problem persists. I know the test game function doesn't work well with some computers, but i just wanted to know if I could fix it or something.
Think about the kittens man!

http://members.aol.com/johnk0/godkills.jpg

MrColossal

I personally never use test game because it can cause problems, I just leave the compile folder open on my desktop and run the game from there, hitting test game doesn't really save me any more time than going "alt tab, click click"
"This must be a good time to live in, since Eric bothers to stay here at all"-CJ also: ACHTUNG FRANZ!

Estaog

Think about the kittens man!

http://members.aol.com/johnk0/godkills.jpg

SMF spam blocked by CleanTalk