GUI not visible

Started by Icey, Sat 19/03/2011 05:42:34

Previous topic - Next topic

Icey

I didn't see a reason to start a whole new topic that is sorta based on the same thing.

I have a Indicators to Display hP on GUI's.

through all the battles in the game the last one for some reason wont show the GUI's. There are 2 GUI's
-My_Hp
-EnemyHP

Bow I did what monkey said a it shows that GUI's are not off screen, There in fact where I set them to be, I tried to make it visible before the screen loaded and after the screen loaded to see if it is really there. I tried to Tween it's transparency to 0 to make it visible. However they are still not showing. I read through the script and yet there is nothing there to stop it from bring visible.

Example of whats called when you attack.
Code: ags

  ///////////////////////////////////////////
   Enemy_Hp2.Visible = false;
   Enemy_Hp2.TweenTransparency(0.1, 100);
   Enemy_Hp2.SetPosition(420, 215);
   Enemy_Hp2.Visible = true;
   Enemy_Hp2.TweenTransparency(0.5, 0, eLinearTween, eNoBlockTween);
   Enemy_Hp2.TweenPosition(0.8, 420, 215, eEaseOutTween, eBlockTween);
      Enemy_Hp.Visible = false;
   ///////////////////////////////////////////


Example of whats called when your attacked.
Code: ags

   ///////////////////////////////////////////
   HP1.Text = "15";
   HP1.TextColor = 4;
   My_Hp2.Visible = false;
   My_Hp2.TweenTransparency(0.1, 100);
   My_Hp2.SetPosition(392, 270);
   My_Hp2.Visible = true;
   My_Hp2.TweenTransparency(0.5, 0, eLinearTween, eNoBlockTween);
   My_Hp2.TweenPosition(0.8, 392, 270, eEaseOutTween, eBlockTween);
      My_Hp2.Visible = false;
   ///////////////////////////////////////////





Khris

Judging from the screenshots your game is 320, is it actually 640 but uses upscaled 320 graphics?
Because the coordinates you're using are off-screen for a 320 game.

If we're talking scrolling rooms, keep in mind that GUIs are positioned using screen coordinates, not room coordinates.
Subtract GetViewportX() and GetViewportY() to get to the screen coords.

Icey

The room size is around 500 x by something however there is a room before that is also a little bigger then 320, All I had to do was select the X, Y in the room and it worked like I wanted it to. But why does it not do the same here.

monkey0506

GUI, Overlay, and Mouse positions are always (always, always, always) screen-coordinates. Character, Hotspot, and Object positions are room-coordinates.

Khris

I just told you, GUIs are positioned in relation to the screen, not the room.
Screen coordinates are in the range of x:0-319, y:0-199/239.

Try this:

Code: ags
  ///////////////////////////////////////////
   Enemy_Hp2.Visible = false;
   Enemy_Hp2.TweenTransparency(0.1, 100);
   Enemy_Hp2.SetPosition(420 - GetViewportX(), 215 - GetViewportY());
   Enemy_Hp2.Visible = true;
   Enemy_Hp2.TweenTransparency(0.5, 0, eLinearTween, eNoBlockTween);
   Enemy_Hp2.TweenPosition(0.8, 420 - GetViewportX(), 215 - GetViewportY(), eEaseOutTween, eBlockTween);
   Enemy_Hp.Visible = false;
   ///////////////////////////////////////////

Icey


SMF spam blocked by CleanTalk