Game Development Community

GuiBitmapCtrl problem

by CIMO · in General Discussion · 06/19/2006 (3:39 am) · 11 replies

I create a GuiBitmapCtrl button...But i have the problem with the image visualization....
I have create a image "15x15" png image...
In profile Bitmap Button i insert this:
new GuiBitmapButtonCtrl(Chiudi) {
      profile = "GuiDefaultProfile";
      horizSizing = "relative";
      vertSizing = "relative";
      position = "731 108";
      extent = "20 20";
      minExtent = "8 2";
      visible = "1";
      command = "Canvas.popDialog(RadioDlg);";
      text = "Button";
      groupNum = "-1";
      buttonType = "PushButton";
         bitmap_n = "./radio/chiudi_n.png";
         bitmap_h = "./radio/chiudi_h.png";
         bitmap_d = "./radio/chiudi_d.png";
         bitmap_i = "./radio/chiudi_i.png";
   };
But my image not see...Why?

#1
06/19/2006 (6:39 am)
Hello,

Here's a bit of script that works well for my bitmap buttons . . .

new GuiBitmapButtonCtrl(exitButton2) {
      profile = "GuiButtonProfile";
      horizSizing = "right";
      vertSizing = "top";
      position = "59 430";
      extent = "42 42";
      minExtent = "8 8";
      visible = "1";
      command = "quit();";
      text = "Quit";
      groupNum = "-1";
      buttonType = "PushButton";
      bitmap = "./buttons/exit";
         helpTag = "0";
   };

You also might want to check out the mini-guide to using bitmap buttons in this thread . . .

www.garagegames.com/mg/forums/result.thread.php?qt=46035

I hope that helps,

Aaron E.
#2
06/19/2006 (12:05 pm)
Never...
I set my button in this mode:
new GuiBitmapButtonCtrl(Chiudi) {
      profile = "GuiButtonProfile";
      horizSizing = "relative";
      vertSizing = "relative";
      position = "730 107";
      extent = "15 15";
      minExtent = "8 2";
      visible = "1";
      command = "Canvas.popDialog(RadioDlg);";
      text = "Button";
      groupNum = "-1";
      buttonType = "PushButton";
      bitmap = "./radio/chiudi.png";
   };

and in consolle i have this problem:
Could not locate texture: starter.fps/client/ui/radio/chiudi.png_n
Could not locate texture: starter.fps/client/ui/radio/chiudi.png_h
Could not locate texture: starter.fps/client/ui/radio/chiudi.png_d
Could not locate texture: starter.fps/client/ui/radio/chiudi.png_i
I put my image in "starter.fps/client/ui/radio/" but never....
WHY?
#3
06/19/2006 (12:18 pm)
I'm pretty sure it's because you're not supposed to specify the extension of the image file.

right:
bitmap = "./radio/chiudi";

wrong:
bitmap = "./radio/chiudi.png";
#4
06/19/2006 (12:23 pm)
In my post i have a exstension ".png"....
I test to eliminate that and......Now work?!?!?
#5
06/19/2006 (12:24 pm)
I have no idea what you're talking about Cimo, sorry.
#6
06/19/2006 (12:26 pm)
In my post...."read up"...
I insert a ".png".... and don't work...
Now i eliminate a extension ".png" and now FUNCTION....
Why this?
I learn
THANKS
#7
06/19/2006 (12:28 pm)
Torque automatically tries all known extensions for image files.
it's just the way torque is.

so,
you could name your image file "foo.jpg" or "foo.png" and torque will still find it.

it's definitely confusing sometimes !

cheers
#8
06/19/2006 (12:29 pm)
Ohhhhh i learn...THANKS for all ;)
#9
06/19/2006 (12:29 pm)
That's just the way it is designed--when you give the "stem" (without the extension), Torque will search for the 4 different textures for the 4 different button states that are expected, and automatically searches for either .png or .jpg files, and uses whichever it finds that meets all the conditions.

All you have to do in your Gui button is to define the "stem"--no file extension or _n/_i/_h/_d.
#10
06/19/2006 (12:34 pm)
There does seem to be an issue, if you use a full path by using the browser, it will not show, if you use the. /name it will not show, but if you load it via some other control, THEN use. /name it will find it.
#11
06/19/2006 (12:37 pm)
Whit a "image base_file" (whit never extension) now work fine ;) the Torque search automaticly a file with _i _n _d _h =)
I lear =) very thanks =D