hud?
-
- Posts: 33
- Joined: Sat Oct 16, 2004 11:52 pm
- Location: Earth
hud?
hey all, im working on my hud my right now, got some questions.
do you think it would be better to create separate images for each resolution?
OR
is there a way to scale images?
thanks all
do you think it would be better to create separate images for each resolution?
OR
is there a way to scale images?
thanks all
HTML/CSS/Javascript/ASP/PHP/SQL/XML/QBasic
Next Up: C++
Next Up: C++
-
- Posts: 33
- Joined: Sat Oct 16, 2004 11:52 pm
- Location: Earth
-
- Posts: 33
- Joined: Sat Oct 16, 2004 11:52 pm
- Location: Earth
-
- Posts: 32
- Joined: Sun Nov 23, 2003 10:23 pm
I'm not sure if this is what you want to do but if you have seperate images for each resolution you can change the path irrlicht is looking to.
Create to subfolders in you media folder and change path regarding the resolution:
if 800x 600
device->getFileSystem()->changeWorkingDirectoryTo("./media/gfx800x600/");
else if 1024 x 768
device->getFileSystem()->changeWorkingDirectoryTo("./media/gfx1024x768/");
Then load the images without path
backgroundTexture = driver->getTexture("background.tga");
Use the same names for big and small images.
Problem if you want to change the path later in the game. Say you are in "./media/gfx800x600/" and you change the res to 1024x768 you have to set the path to "../1024x768".
But maybe you can get the working directory at the start of your game/application (getWorkingDirectory), save to a string and then add the gfx path. Dont know if and how this works.
Hope this helps
Create to subfolders in you media folder and change path regarding the resolution:
if 800x 600
device->getFileSystem()->changeWorkingDirectoryTo("./media/gfx800x600/");
else if 1024 x 768
device->getFileSystem()->changeWorkingDirectoryTo("./media/gfx1024x768/");
Then load the images without path
backgroundTexture = driver->getTexture("background.tga");
Use the same names for big and small images.
Problem if you want to change the path later in the game. Say you are in "./media/gfx800x600/" and you change the res to 1024x768 you have to set the path to "../1024x768".
But maybe you can get the working directory at the start of your game/application (getWorkingDirectory), save to a string and then add the gfx path. Dont know if and how this works.
Hope this helps
-
- Posts: 33
- Joined: Sat Oct 16, 2004 11:52 pm
- Location: Earth
hey, thats actually a nice idea, might have to mess around with that in the future. what im really looking for now i guess is a way to only show one area of an image. i cant for the life of me figure out how to do that by looking through the docs....
HTML/CSS/Javascript/ASP/PHP/SQL/XML/QBasic
Next Up: C++
Next Up: C++
-
- Posts: 32
- Joined: Sun Nov 23, 2003 10:23 pm
Search for draw2DImage in the API.
Is that what you are looking for?
Code: Select all
driver->draw2DImage(texture, // the image
core::rect<s32>(0, 0, 50, 50), // Destination on screen
core::rect<s32>(50,50,100,100), // Rect from image
0,
video::SColor(255,255,255,255),
true);
-
- Posts: 33
- Joined: Sat Oct 16, 2004 11:52 pm
- Location: Earth
-
- Posts: 33
- Joined: Sat Oct 16, 2004 11:52 pm
- Location: Earth
-
- Posts: 32
- Joined: Sun Nov 23, 2003 10:23 pm
-
- Posts: 33
- Joined: Sat Oct 16, 2004 11:52 pm
- Location: Earth