Sprite Candy Users

Blitz3D Forums/Blitz3D Programming/Sprite Candy Users

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.

Function gui_ScaleWindow_Relative(Window%,OrigResX#=640,OrigResY#=480)
	Gw#=GraphicsWidth()
	Gh#=GraphicsHeight()
	If gw=OrigResX Then Return
	POSX#= HUD_GetObjectX (window, True)
	POSY#= HUD_GetObjectY (window, True)
	newx#=(1/(Float(OrigResX))*Float(posx))
	newy#=(1/(Float(OrigResY))*Float(posy))
	NewPosX#=gw*newx
	NewPosy#=gh*newy
	sx_p#=(gw# / origresx#)
	sy_p#=(gh# / OrigResY#)
	HUD_SetObjectScale (Window%,sx_p,sy_p)
	HUD_PositionObject WINDOW%,NEWPOSX,NEWPOSY
End Function