Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Camera Zoom


Jumbofile
 Share

Recommended Posts

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.
Link to comment
Share on other sites

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)
Link to comment
Share on other sites

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

![](http://eclipseorigins.com/community/filehost/1fc33a7715916072c858d2f4387b0d2b.png)

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

![](http://eclipseorigins.com/community/filehost/5398bfaa6bfc988e16be35fdd0834b31.png)
Link to comment
Share on other sites

> 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)

![](http://eclipseorigins.com/community/filehost/bc6e0d47dfbb35000eea6aa1e11d7e16.png)

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

![](http://eclipseorigins.com/community/filehost/54658f77112e71e93edca2911765cabc.png)

but this is what the engine will show you

![](http://eclipseorigins.com/community/filehost/c88c0e3a3631a5532fb7706d4a297e6f.png)

i don't know how to fix this but i have my own method of scalling.. i mean zooming..
Link to comment
Share on other sites

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?
Link to comment
Share on other sites

> 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
Link to comment
Share on other sites

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. :(
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...