Multiple Images not working in HFL
by Neil M. · in Torque Game Engine · 12/23/2005 (7:47 am) · 6 replies
Hi,
I'm sure this is just a simple problem, however its the only annoying snag i've ran into thus far :)
I have put together a user HFL help file for the controls in my game. It contains 7 different jpg images to help illustrate the guide, however ALL of the images only show up as the 1st images in the help file. All images are in the correct directory. I have attempted to use png's rather then jpg but that did not solve the issue.
Here is the actual help file, as you can see each image is its own unique file.
To fully enjoy your exploration of the 3D world please familiarize yourself with the following methods of control:
Walking:
Use the following keys on the keypad to walk within the 3D world.
8 Forward
2 Backward
4 Step left
6 Step right
Turning and Looking:
By moving the mouse you can control the direction you are facing. This is perfect for while you are standing still and wish to get a better view the surroundings.
By looking in a new direction while you are walking, you will move in that direction. This method can be used to turn corners.
Jumping:
You can jump by pressing the Enter key on your keypad. This can prove useful if you wish to get to a new higher location or to by pass an object that maybe blocking your progress.
Enter Jump
Activating Doors:
Place your mouse cursor over top of a door within the 3D world, then click using the Left Mouse Button. This will open the door, or close an opened door.
Reset Position:
Press the 0 or 000 key on the keypad to reset your position in world back to the original starting point. This is useful if you ever get lost or become stuck at any point.
0 Reset Position
000 Reset Position
Getting Help:
If you require any help while in the 3D world, you can press the '*' key to bring up this Help menu.
* Open Help Menu
Quitting:
Press the 'Backspace' key if you wish to leave the 3D world and return to the Main Screen. Click 'Yes' on the Quit menu to confirm your choice, or click 'No' to cancel.
Backspace Quit
I'm sure this is just a simple problem, however its the only annoying snag i've ran into thus far :)
I have put together a user HFL help file for the controls in my game. It contains 7 different jpg images to help illustrate the guide, however ALL of the images only show up as the 1st images in the help file. All images are in the correct directory. I have attempted to use png's rather then jpg but that did not solve the issue.
Here is the actual help file, as you can see each image is its own unique file.
Use the following keys on the keypad to walk within the 3D world.
8 Forward
2 Backward
4 Step left
6 Step right
By moving the mouse you can control the direction you are facing. This is perfect for while you are standing still and wish to get a better view the surroundings.
By looking in a new direction while you are walking, you will move in that direction. This method can be used to turn corners.
You can jump by pressing the Enter key on your keypad. This can prove useful if you wish to get to a new higher location or to by pass an object that maybe blocking your progress.
Enter Jump
Place your mouse cursor over top of a door within the 3D world, then click using the Left Mouse Button. This will open the door, or close an opened door.
Press the 0 or 000 key on the keypad to reset your position in world back to the original starting point. This is useful if you ever get lost or become stuck at any point.
0 Reset Position
000 Reset Position
If you require any help while in the 3D world, you can press the '*' key to bring up this Help menu.
* Open Help Menu
Press the 'Backspace' key if you wish to leave the 3D world and return to the Main Screen. Click 'Yes' on the Quit menu to confirm your choice, or click 'No' to cancel.
Backspace Quit
About the author
#2
I was looking at this in onRender:
walk->bitmap->bitmaphandle-object-texFileName
01/02/2006 (5:56 am)
I'm not sure how to debug this. In the onRender loop it always starts repainting after it hits the first image so the filename never changes. If I change the breakpoint hit count then I can see the next filename in the list but I can't seem to track down where exactly the parsing starts.I was looking at this in onRender:
walk->bitmap->bitmaphandle-object-texFileName
#3
01/08/2006 (2:18 am)
I'm not sure I understand your first paragraph - if you look at the GuiMLTextCtrl's members, there should be a pointer to a linked list of Bitmaps. That list SHOULD have valid data in it, ie, every bitmap has different filename.
#4
Con::printf( "Bitmap name %s", walk->bitmap->bitmapName );
to GuiMLTextCtrl::onRender and all I get in the console is:
Bitmap name
Bitmap name
Bitmap name
Bitmap name
etc...
So I'm unable to see the filename that way.
Lets see if I can describe the breakpoint issue again... If I put a breakpoint in the onRender function, I can see the first filename in the loop. If I press F10 to continue through the onRender event fires again and it shows me the first item again. I can't seem to ever get to item two in the linked list UNLESS I use visual studio's breakpoint feature that lets me break on the second time through the loop. Then I see the second filename, but I can't see the 1st, 3rd, 4th, etc...
01/09/2006 (5:44 am)
I added the lineCon::printf( "Bitmap name %s", walk->bitmap->bitmapName );
to GuiMLTextCtrl::onRender and all I get in the console is:
Bitmap name
Bitmap name
Bitmap name
Bitmap name
etc...
So I'm unable to see the filename that way.
Lets see if I can describe the breakpoint issue again... If I put a breakpoint in the onRender function, I can see the first filename in the loop. If I press F10 to continue through the onRender event fires again and it shows me the first item again. I can't seem to ever get to item two in the linked list UNLESS I use visual studio's breakpoint feature that lets me break on the second time through the loop. Then I see the second filename, but I can't see the 1st, 3rd, 4th, etc...
#5
If the filename was a different length, then it would pickup the new image, if not it would use the same old one. I narrowed it down to the GuiMLTextCtrl::Bitmap *GuiMLTextCtrl::allocBitmap function in guiMLTextCtrl.cc
If you look at the if statement:
You'll notice that it does a string compare on the filename... If you remote the ! (not) from the if, then the help files display properly...
01/09/2006 (7:46 am)
Thanks to Deden and Omroth on the IRC I figured it out.If the filename was a different length, then it would pickup the new image, if not it would use the same old one. I narrowed it down to the GuiMLTextCtrl::Bitmap *GuiMLTextCtrl::allocBitmap function in guiMLTextCtrl.cc
If you look at the if statement:
if(bitmapNameLen == walk->bitmapNameLen &&
!dStrncmp(walk->bitmapName, bitmapName, bitmapNameLen))
return walk;You'll notice that it does a string compare on the filename... If you remote the ! (not) from the if, then the help files display properly...
if(bitmapNameLen == walk->bitmapNameLen &&
dStrncmp(walk->bitmapName, bitmapName, bitmapNameLen))
return walk;
#6
09/11/2006 (6:44 pm)
Thanks Genesis, you saved me some headache there.
Associate Ben Garney