Camera Zoom

How would I make it for the camera in EO3.0 zoom in 2x so I dont have to resize all of my graphics?

hmm i dont get it?

I need to make the camera zoom in so it gives the illusion of every tile being 64x64

other than scaling, i don’t think its possible in any EO engines on DX8. I’ve done this before and it requires everything to be rendered in 3d space(or matrix?) onto a surface and used the camera for zoom control.

It’s possible lol, Thomas [deathbeam] did that for me a few years ago.

Possible… already done this before…

Look on  this code

Call RenderTexture(Texture, X, Y, StartingXofThePicture, StartingYofThePicture, (Here is the code on scalling the graphics X), (Here is the code on scalling the graphics Y), SizeOfTheGraphicsX, SizeOfTheGraphicsY)

But this method may fail… i forgot what i did before that’s why i can’t tell you what to change.

SherwiN is right, it’s not really a “zoom” you simply render the texture into a larger surface size than the images actual dimensions.

If you look at your Sub DrawMapTIle you’ll find

RenderTexture Tex_Tileset(.layer(I).Tileset), ConvertMapX(X * PIC_X), ConvertMapY(Y * PIC_Y), .layer(I).X * 32, .layer(I).Y * 32, 32, 32, 32, 32, -1

Without testing it, this “should” work RenderTexture Tex_Tileset(.layer(I).Tileset), ConvertMapX(X * PIC_X), ConvertMapY(Y * PIC_Y), .layer(I).X * 32, .layer(I).Y * 32, 64, 64, 32, 32, -1

Render Texture uses the variables (ByRef TextureRec As DX8TextureRec, ByVal dX As Single, ByVal dY As Single, ByVal sx As Single, ByVal sy As Single, ByVal dWidth As Single, ByVal dHeight As Single, ByVal sWidth As Single, ByVal sHeight As Single, Optional color As Long = -1, Optional ByVal Degrees As Single = 0), so you want to change the Destination With and Destination Height (dWidth and dHeight)

Thanks for the help everyone, Rob, using the code you gave me I got this.

This is what I’m aiming to do (edited in paint lol)

SherwiN is right, it’s not really a “zoom” you simply render the texture into a larger surface size than the images actual dimensions.

If you look at your Sub DrawMapTIle you’ll find

RenderTexture Tex_Tileset(.layer(I).Tileset), ConvertMapX(X * PIC_X), ConvertMapY(Y * PIC_Y), .layer(I).X * 32, .layer(I).Y * 32, 32, 32, 32, 32, -1

Without testing it, this “should” work RenderTexture Tex_Tileset(.layer(I).Tileset), ConvertMapX(X * PIC_X), ConvertMapY(Y * PIC_Y), .layer(I).X * 32, .layer(I).Y * 32, 64, 64, 32, 32, -1

Render Texture uses the variables (ByRef TextureRec As DX8TextureRec, ByVal dX As Single, ByVal dY As Single, ByVal sx As Single, ByVal sy As Single, ByVal dWidth As Single, ByVal dHeight As Single, ByVal sWidth As Single, ByVal sHeight As Single, Optional color As Long = -1, Optional ByVal Degrees As Single = 0), so you want to change the Destination With and Destination Height (dWidth and dHeight)

“Should” is “Shouldn’t”

scalling the image on that code might cover the relative graphics, I’m not good on english so i’ll explain it graphically

for example this is the image tileset you are using , Normal size (32x32)

here’s what you expected because of the logic on rendering

but this is what the engine will show you

i don’t know how to fix this but i have my own method of scalling… i mean zooming…

You’d have the Tweak places where it calls “RenderTexture” to adjust the destination width and height to 64x64 in other places as well, not just in DrawMapTile, it was just an example.

I’m not entirely sure I follow your issue though Sherwin? I’ve never run into an issue where rendering into a source plane 2x the size has given me the artefact border unless I’m trying to stretch an that wasn’t initially to the power of 2, or putting it into a surface that isn’t to a power of 2?

You’d have the Tweak places where it calls “RenderTexture” to adjust the destination width and height to 64x64 in other places as well, not just in DrawMapTile, it was just an example.

I’m not entirely sure I follow your issue though Sherwin? I’ve never run into an issue where rendering into a source plane 2x the size has given me the artefact border unless I’m trying to stretch an that wasn’t initially to the power of 2, or putting it into a surface that isn’t to a power of 2?

Try the zooming using RenderTexture scalling image only at tilesets… you’ll get the problem

don’t add anything else. just double the scale size

This is way out of my programming ability, one of you mind helping me out?

Bump

The camera will stretch for you, all you need to do is change the minimum values usually MAX_MAPX and MAX_MAPY. You then change the surface size in InitDX8 to be a different size than the form to the ratio you want to scale. For example, if your form size is 1024x768, you want to set your game’s resolution to half that in InitDX8. By doing this, it will force the textures to 2x size making the game more zoomed in. I may have it backwards though.

This is one of the harder aspects of programming, you’re gonna have to work hard to figure it out. There’s a lot of things that can cause it not to stretch the game such as if you use a picScreen and not the actual form, this may have side effects. I only use picScreen cause I would have to redo my engine’s entire pictures from scratch and reorganize everything. Rather, I will just do it for 1.3.0.

People aren’t gonna code your game for you. 😞

People aren’t gonna code your game for you. 😞

Aha… you got that right~

People won’t work without motivation (unless it’s Santa)

Log in to reply