Game Development Community

Force GUI Update

by AIDan · in Torque Game Engine · 10/15/2001 (8:33 am) · 4 replies

Hi

When I pickup a weapon, it changes my crosshair.

EgoCrosshair.bitmap= %data.crosshairFile;

But the crosshair does not appear. When I enter the editor and leave it again, the crosshair appears.

How can I force him to update the crosshair directly??

greetings
Daniel

#1
10/15/2001 (9:01 am)
When I hide the crosshair and make it visible after changing the bitmap, the frame appears but not the bitmap itself.

It seems like it is not loaded.

Other question: How can I keep a bitmap in the memory??

I use another crosshair when I zoom. Everytime I change zoom, it loads the bitmap again. That makes the game stuck for a half second.
And a half second is much in a game.

greetings
Daniel
#2
10/15/2001 (9:15 am)
use the function setbitmap instead of changing the bitmap manualy

something like this: hud.setbitmap(bitmap);

That worked for me
#3
10/15/2001 (9:24 am)
It works. my mistake. You cannot use ~
#4
10/15/2001 (6:07 pm)
This is something that we should look into fixing, right now only the datablocks accept relative paths, include the mod root '~', so you must pass fully specified files to functions like gui.setBitmap("filename");

The relative path and mod root stuff is something we added fairly recently (a couple months ago) and it isn't quite fully supported.