Spot on Texture

Blitz3D Forums/Blitz3D Programming/Spot on Texture

Well, your formula for positioning your texture should be something like this:

t_scale_x = 0.1
t_scale_y = 0.1

t_coord_x = 0.3 ; coords range between 0 and 1
t_coord_y = 0.7 ; coords range between 0 and 1

ScaleTexture texture , t_scale_x , t_scale_y

PositionTexture texture, t_coord_x * (1/t_scale_x) , t_coord_y * (1/t_scale_y)



That should work, as long as you adjust the variables when your going to scale the texture, and when your going to move the texture. Remember, the textures co-ords are always between 0 and 1, to keep it simple. 0 being left most and 1 being right most for x. Same for y, cept on a the Y axis.

For example, say you scaled the texture down a bit, and wanted to position it in the centre, then you would do:

[code]
t_scale_x = 0.01
t_scale_y = 0.01

t_coord_x = 0.5 ; coords range between 0 and 1
t_coord_y = 0.5 ; coords range between 0 and 1

ScaleTexture texture , t_scale_x , t_scale_y

PositionTexture texture, t_coord_x * (1/t_scale_x) , t_coord_y * (1/t_scale_y)



Hope that helps some more :)