Jump to content

[HELP] Rotating the image of the minimap.


csutee

Recommended Posts

Hello, first of all I'm not a professional scripter as you can see, but i was trying to create a simple radar(minimap) and i have turned into failure when i was trying to make it rotating. So i made the image selection with dxDrawImageSection and this function's rotation makes the whole image rotating, which is not my final goal. If you can help me to understand it I would be so thankful.

This is the remapping function what I would like to use:

function reMap(value, low1, high1, low2, high2)
    return low2 + (value - low1) * (high2 - low2) / (high1 - low1)
end

 

Link to comment

You could do this via a rendertarget (draw the rotated image on the RT and draw the render target unrotated) (RTs aren't designed for this purpose, however. RTs are slower than drawing the contents individually unless you write to them less often than every frame), or via a shader

Edited by MrTasty
Link to comment

Okey, now i know what rendertarget is doing, however i still don't know how to count with it. When i turn my camera by 90 degree there is 2 blank transparent thing at the minimap and I don't know how should I fix it. So i would be more thankful if you or anyone could let me understand it how it works and how to work with it.

Link to comment
  • Discord Moderators

I'd rather use a shade than a rt, with AddressU and V set to 'Border'  and BorderColor to the color of water.
But if you want to do it in Lua, then, set the rt, draw a rectangle with the color of water, then draw the image.

Link to comment

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...