A Main Menu
by Doug Linley · in Torque Game Builder · 06/29/2006 (6:27 pm) · 6 replies
I'm trying to create a main menu with GUIBitmapButtonCtrl. When I run the game I get the following errors.
I do have all of those images, but I named them
When I rename them to satisfy the error above, I get the following errors:
Does anyone know what I'm doing wrong?
Could not locate texture: WhackAMole/data/images/boardalpha.png_h Could not locate texture: WhackAMole/data/images/boardalpha.png_d Could not locate texture: WhackAMole/data/images/boardalpha.png_i Could not locate texture: WhackAMole/data/images/boardalpha.png_h Could not locate texture: WhackAMole/data/images/boardalpha.png_d Could not locate texture: WhackAMole/data/images/boardalpha.png_i
I do have all of those images, but I named them
boardalpha_h.png boardalpha_d.png boardalpha_i.png
When I rename them to satisfy the error above, I get the following errors:
ResourceObject::construct: NULL resource create function for 'boardalpha.png_h'. ResourceObject::construct: NULL resource create function for 'boardalpha.png_h'. ResourceObject::construct: NULL resource create function for 'boardalpha.png_h'. ResourceObject::construct: NULL resource create function for 'boardalpha.png_h'. Could not locate texture: WhackAMole/data/images/boardalpha.png_h ResourceObject::construct: NULL resource create function for 'boardalpha.png_d'. ResourceObject::construct: NULL resource create function for 'boardalpha.png_d'. ResourceObject::construct: NULL resource create function for 'boardalpha.png_d'. ResourceObject::construct: NULL resource create function for 'boardalpha.png_d'. Could not locate texture: WhackAMole/data/images/boardalpha.png_d ResourceObject::construct: NULL resource create function for 'boardalpha.png_i'. ResourceObject::construct: NULL resource create function for 'boardalpha.png_i'. ResourceObject::construct: NULL resource create function for 'boardalpha.png_i'. ResourceObject::construct: NULL resource create function for 'boardalpha.png_i'. Could not locate texture: WhackAMole/data/images/boardalpha.png_i ResourceObject::construct: NULL resource create function for 'boardalpha.png_h'. ResourceObject::construct: NULL resource create function for 'boardalpha.png_h'. ResourceObject::construct: NULL resource create function for 'boardalpha.png_h'. ResourceObject::construct: NULL resource create function for 'boardalpha.png_h'. Could not locate texture: WhackAMole/data/images/boardalpha.png_h ResourceObject::construct: NULL resource create function for 'boardalpha.png_d'. ResourceObject::construct: NULL resource create function for 'boardalpha.png_d'. ResourceObject::construct: NULL resource create function for 'boardalpha.png_d'. ResourceObject::construct: NULL resource create function for 'boardalpha.png_d'. Could not locate texture: WhackAMole/data/images/boardalpha.png_d ResourceObject::construct: NULL resource create function for 'boardalpha.png_i'. ResourceObject::construct: NULL resource create function for 'boardalpha.png_i'. ResourceObject::construct: NULL resource create function for 'boardalpha.png_i'. ResourceObject::construct: NULL resource create function for 'boardalpha.png_i'. Could not locate texture: WhackAMole/data/images/boardalpha.png_i
Does anyone know what I'm doing wrong?
#2
The other images I am not specifying. The engine is looking for them automatically.
06/30/2006 (5:31 am)
So when the level editor automatically puts the path and filename for the button background in the gui editor, I should remove the .png for the base image. Is that what you're saying?The other images I am not specifying. The engine is looking for them automatically.
#3
06/30/2006 (6:02 am)
Yes, leave away the suffix, so imagePath = "boardalpha_h"; for example. Torque automatically searches in the directories for the file and appends the necessary suffixes depending on what kind of image it found (like jpeg, png etc.).
#4
06/30/2006 (7:23 am)
Thanks Adam & Martin. I'll give that a shot.
#5
imagePath = "border_alpha";
The code takes care of the rest. It will look for, and link in if found, 4 different images, of either png or jpg format, after dynamically adding the _n, _h, _i, and _d.
06/30/2006 (8:13 am)
Actually, you don't even want to put the _h at the end. All you want to do is to put in:imagePath = "border_alpha";
The code takes care of the rest. It will look for, and link in if found, 4 different images, of either png or jpg format, after dynamically adding the _n, _h, _i, and _d.
#6
1. In the mole game example, there is a wooden scoreboard. I wanted to break that into a seperate gui and then have it slide in from the side of the screen into position.
2. I want to fade GUI elements into the screen.
3. If I give the button a class like startButton, can I enable mouse events on it and setup actions in an onMouseDwon event?
4. Is it possible to setup animated bitmapped gui buttons?
Thanks again.
06/30/2006 (9:39 am)
Thanks gang. That did the trick. There are some other things that I was wanting to do with GUIs but I'm not sure how possible it is. I've listed them below. Your feedback would be greatly appreciatted.1. In the mole game example, there is a wooden scoreboard. I wanted to break that into a seperate gui and then have it slide in from the side of the screen into position.
2. I want to fade GUI elements into the screen.
3. If I give the button a class like startButton, can I enable mouse events on it and setup actions in an onMouseDwon event?
4. Is it possible to setup animated bitmapped gui buttons?
Thanks again.
Torque Owner Adam Larson