AngeliA
Search Results for

    Show / Hide Table of Contents

    Struct AfterimageScope

    Draw a continuous tailing cell effect for the objects rendering inside

    Implements
    IDisposable
    Examples
    using AngeliA;
    
    namespace AngeliaGame;
    
    public class Example {
    
    	static int CurrentX = 0;
    	static int CurrentY = 0;
    	static int CurrentRot = 0;
    
    	[OnGameUpdate]
    	internal static void OnGameUpdate () {
    
    		int speedX = QTest.Int("Speed X", 50, -64, 64);
    		int speedY = QTest.Int("Speed Y", 10, -64, 64);
    		int rotateSpeed = QTest.Int("Rotate Speed", 8, -64, 64);
    		int count = QTest.Int("Count", 8, 1, 24);
    		int frameStep = QTest.Int("Frame Step", 16, 1, 32);
    		int scaleStart = QTest.Int("Scale Start", 1000, 0, 2000);
    		int scaleEnd = QTest.Int("Scale End", 100, 0, 2000);
    
    		using (new AfterimageScope(
    			speedX, speedY, Color32.WHITE, Color32.CLEAR, 
    			rotateSpeed, count, frameStep, scaleStart, scaleEnd
    		)) {
    
    			var cameraRect = Renderer.CameraRect;
    
    			// Render object here
    			Renderer.Draw(
    				BuiltInSprite.ICON_ENTITY,
    				cameraRect.x + CurrentX,
    				cameraRect.y + CurrentY,
    				500, 500, CurrentRot,
    				Const.CEL * 2, Const.CEL * 2
    			);
    
    			// Move the object
    			CurrentX += speedX;
    			CurrentY += speedY;
    			CurrentRot += rotateSpeed;
    			CurrentX = CurrentX.UMod(cameraRect.width);
    			CurrentY = CurrentY.UMod(cameraRect.height);
    
    		}
    
    	}
    
    }

    Constructors

    AfterimageScope(int, int, Color32, Color32, int, int, int, int, int, int)

    Draw a continuous tailing cell effect for the objects rendering inside

    Declaration
    public AfterimageScope(int speedX, int speedY, Color32 tintStart, Color32 tintEnd, int rotateSpeed = 0, int count = 3, int frameStep = 2, int scaleStart = 1000, int scaleEnd = 1000, int renderLayer = 3)
    Parameters
    Type Name Description
    int speedX

    How fast is the object moves horizontaly

    int speedY

    How fast is the object moves verticaly

    Color32 tintStart

    Color tint for start of the effect

    Color32 tintEnd

    Color tint for end of the effect

    int rotateSpeed

    How fast does the object rotate

    int count

    How many effect should be drawn

    int frameStep

    Frame distance between each effects

    int scaleStart

    Size scale when the effect start (0 means 0%, 1000 means 100%)

    int scaleEnd

    Size scale when the effect end (0 means 0%, 1000 means 100%)

    int renderLayer

    Which layer does this effect renders into. Use RenderLayer.XXX to get the value.

    AfterimageScope(int, int, int, int, int, int, int, int)

    Draw a continuous tailing cell effect for the objects rendering inside

    Declaration
    public AfterimageScope(int speedX, int speedY, int rotateSpeed = 0, int count = 3, int frameStep = 2, int scaleStart = 1000, int scaleEnd = 1000, int renderLayer = 3)
    Parameters
    Type Name Description
    int speedX

    How fast is the object moves horizontaly

    int speedY

    How fast is the object moves verticaly

    int rotateSpeed

    How fast does the object rotate

    int count

    How many effect should be drawn

    int frameStep

    Frame distance between each effects

    int scaleStart

    Size scale when the effect start (0 means 0%, 1000 means 100%)

    int scaleEnd

    Size scale when the effect end (0 means 0%, 1000 means 100%)

    int renderLayer

    Which layer does this effect renders into. Use RenderLayer.XXX to get the value.

    Methods

    Dispose()

    Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

    Declaration
    public void Dispose()
    Back to top ๐Ÿ„๐Ÿฆโ€โฌ›๐Ÿงฆ๐Ÿˆ๐ŸŽƒ๐Ÿ’“๐ŸŒนโ˜•๐Ÿดโ€โ˜ ๏ธ๐Ÿค