Same 'size' in different screen sizes

Blitz3D Forums/Blitz3D Programming/Same 'size' in different screen sizes

JBR(Posted 2004) [#1]
Hello, I am needing a square radar in the top left of my screen.

I plan on using CreateTexture to create a 128 by 128 pixel texture which is then placed using a quad into the top left of the screen.

I will be 'filling' the texture each frame (scrolling).

My question is what is the best way to get the texture onto different screen sizes at the same proportion.

e.g. 1280 by 1024 should be 128 by 128 pixels
e.g. 1024 by 768 should be 102 by 96 pixels
etc

I've heard of using a hudcam but not over different screen sizes.

Any advice
Thanks
Marg


Genexi2(Posted 2004) [#2]
Well shouldnt it all look the same on any rez, though the higher-rez textures will look blurrier on the lowere-rez's?

Just ran one of my old textureblend demo's and this texture that gets displayed on the camera around 3 units away from it looks to be at the exact porpotion no matter what resolution I use. Only thing I can think of as to why you'd want to resize the texture for different resolutions is to make it more sharper looking on the lower-rez's....


Jeroen(Posted 2004) [#3]
Hmmmm I don't know if I understand your problem exactly. If you use a quad, it is "stretched" just like all the other 3d stuff, so you won't have the issue you just stated.
Or...?


Warren(Posted 2004) [#4]
I design my UI and everything that I want drawn in "2D" as if they were always going onto a 640x480 screen. Then my drawing code takes the current resolution into account and scales any positions/sizes passed to it as necessary.


JBR(Posted 2004) [#5]
Thanks, I think I may be looking for problems that are not there.

Regarding writing to the texture; the manual says it is quicker to write to an image and copyrect to the texture.
I plan to lockbuffer the texture and use writepixelfast.

Is this the way to do it?

Marg


Jeroen(Posted 2004) [#6]
Marg, yes, that would be a good way.