GUI resolution doesnt match rest of game and other probs

Started by kejoxen, Mon 19/05/2003 03:48:46

Previous topic - Next topic

kejoxen

my gui seems to be in 320x240 while the rest of my game is in 640x480, although all my inventory sprites are in 64x64 squares and it seems to accomodate 10 (my gui is just an inventory bar across the top of the screen) the pixel size on the gui editor doesnt go above 320 in width, its not a problem everything works fine its just annoying.

<edit>

ok i do have a proper problem now, i wrote this bit of gui script to handle scrolling through the inventory items

if (interface == 2) {
   
   if ((button == 0) & (game.top_inv_item < game.num_inv_items - 7))
     game.top_inv_item = game.top_inv_item + 1;
   if ((button == 1) & (game.top_inv_item > 0))
     game.top_inv_item = game.top_inv_item - 1;
   }

with this is the global script

function game_start() {
 // called when the game starts, before the first room is loaded
   game.items_per_line=7;
     game.num_inv_displayed=7;

i have my gui setup to switch on when the mouse is higher than y32 whats happens on a mouse click then release on either gui button 0 or 1 is that the cursor jumps down to presumably y33 and so the gui switches off. its kinda distracting and you miss the point of the items scrolling across the gui as you click the button.

if i switch the gui to always on of course this dosent happen however the cursor doesnt jump down either

i tried setting the mouse y position to y50 but but it just jumps down to, i guess y51 and so on.

<edit>

and another one, kinda minor but it looks crappy



how come when i click on the arrow you can see the letters 'so' (highlighted professionally in red) , which are the first letters of my games name, how do i correct this?

Ishmael

The first one: The GUI resolution seems to be 320 etc allways in the editor, but if you have sprites for 640 etc, they become resized in the GUI editor, so youll have to position them in the lower res, still they be in high-res in the game.

All the onclick mouse ypos GUIs seem to go off when you click on them, I dont know why. You might try something like this:

make the GUI allways on, and turn it off (with GUIOff();) in the room the player starts, in the player enters screen first time. Then, in all rooms where the GUI should not come up, in the player enters screen before fadein put (in a script) eg SetGlobalInt(100,1); - Pick a Globalint that's free, and in the player leaves screen: SetGlobalInt(100,0);

Then, in the repeatedly_execute:

 if ((GetGlobalInt(100)==0) && (mouse.y < 33)) { // I think its this way
   GUIOn(x); // where x is the inv GUI number
 } else if ((GetGlobalInt(100)==0) && (mouse.y > 32)) {
   GUIOff(x);
 } else if (GetGlobalInt(100)==1) {
   GUIOff(x);
 }

Tell me how it works, ok?

The third: have you got a label there? Or somthing like that? Or does the button haves a 'button text' begining with "So"? I cant really see any other reason for that....

Hope I helped...  ;)
I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

SMF spam blocked by CleanTalk