Sprite Candy Users
Blitz3D Forums/Blitz3D Programming/Sprite Candy Users
| ||
..hey guys, How to set up my HUD with Sprite Candy so it can automatically resize and adjust for every given screen size?? I'm trying to make 16:9 frame..actually Im using 2 textures 1280x128 pixels, so I put one on the top and second one at the bottom of screen..things is nice if screen size is 1280x1024, everything is ok, but when I change screen size to let say 800x600, Im loosing right part of the HUD texture (its cutted off everything whats over 800 pixels)...so, how to set up Sprite Candy to do adjustment automatically for every given screen size, something like Alpha GUI do? |
| ||
Well I use this code snippet (replace HUD_1 with whatever name you've called your hud); ;RESCALE HUD TO CURRENT SCREEN RES HUD_SetScale ( HUD_1, Float(GraphicsWidth())/640,Float(GraphicsHeight())/480 ) HUD_Position (HUD_1, -HUD_GetX ( HUD_1 ) , -HUD_GetY (HUD_1 ) ) HUD_Update() |
| ||
Note that code won't work too well for widescreen resolutions or any res that isn't 4/3. |
| ||
Best e-mail Mike Dogan at X-pressive, he has ALL the answers. IPete2. |
| ||
Talking about Sprite Candy, when I try to generate a gradient font, the tool "font candy" seems to ignore me! It only generates fonts of one color! Someone has that problem too? thanks! |
| ||
I email him, but so far, no answers..what I like about Alpha Gui is that its really taking care about such a things without headache..and it will be so nice if Sprite candy have in builted such a thing..but okay, I guess i have to do it on my own :) |
| ||
I made this for that reason, but its not ideal as the text can get less than perfectly clear when not in the "original scale" To use this you would create your gui scheme with a base res (Say 800x600) , then you could scale it to whatever res , just pass the original res into the function call. |