Jump to content

Limit draw size to texture


Recommended Posts

Hello dear community, I would like to ask if there is a way to limit the draw size to a texture ?

What do I mean, well, I have a texture (A rectangle with rounded corners)

Spoiler

Ixf8sHE.png

well, I want to create an animation. A circle that becomes to a rectangle with BORDER CORNERS

I think I luckily did this script like 4 years ago, but no idea how I did it (I know trat it sounds absurd.)

If im not wrong, I used a shader, and I think it was the HUD Mask Shader: https://nightly.multitheftauto.com/files/shaders/shader_hud_mask.zip

I would like to get any tip or suggestion to start to code the animation, but Im fully stuck.

All the prerequesites were made like creating the RT, restore in case of minimzeing ...etc

Thanks for reading, best regards.

Edited by Overkillz
Link to comment
  • Moderators
40 minutes ago, Overkillz said:

I would like to get any tip or suggestion to start to code the animation, but Im fully stuck

This rectangle exist out of 7 parts.

- 4 corners

- 1 big rectangle, the middle, from left to right

- 2 small rectangles, top and bottom

 

You can animate the big rectangle it's width and height. (+ Position, if not animated from left-top)

The 2 small rectangles, their width and position.

And the corners, their position.

 

But make sure to align the components perfectly with the pixels on the screen. Half pixels might cause artifacts.

 

 

 

 

 

 

 

 

 

 

 

Edited by IIYAMA
  • Like 1
Link to comment

@IIYAMA

Thanks for your suggestion, but, Im not going to reach the effect that Im looking for cuz I think the effect will be notable and not fancy while reaching the corners and the effect im looking for is that a circle over draw the "Rounded rectangle"

I think i have explained pretty bad so I just made a quicky image to take it as reference. As you can see, some parts of the circle already left the rectangle (It won't be visible).

Spoiler

T7CbhLN.png

Otherwise, is there a way to load .svg on MTA ?

Thanks in advance, best regards.

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