AudioAsset
Ease
FastString
FontAsset
NineSlice
PackedSprite
PackedSpriteID
RB
   HardwareSettings
   IRetroBlitGame
RBAsset
Rect2i
ShaderAsset
SoundReference
SpriteGrid
SpriteSheetAsset
TMXMapAsset
   TMXLayer
   TMXLayerLoadState
   TMXObject
   TMXObjectGroup
   TMXProperties
Vector2i

RB.DrawLineTextured

Method  -  Static

public static void DrawLineTextured(Vector2i p0, Vector2i p1, int thickness, Rect2i srcRect, float scroll, float repeat)
public static void DrawLineTextured(Vector2i p0, Vector2i p1, Rect2i srcRect, float scroll, float repeat)
public static void DrawLineTextured(Vector2i p0, Vector2i p1, int thickness, int spriteIndex, float scroll, float repeat)
public static void DrawLineTextured(Vector2i p0, Vector2i p1, int spriteIndex, float scroll, float repeat)
public static void DrawLineTextured(Vector2i p0, Vector2i p1, int thickness, string spriteName, float scroll, float repeat)
public static void DrawLineTextured(Vector2i p0, Vector2i p1, string spriteName, float scroll, float repeat)
public static void DrawLineTextured(Vector2i p0, Vector2i p1, int thickness, FastString spriteName, float scroll, float repeat)
public static void DrawLineTextured(Vector2i p0, Vector2i p1, FastString spriteName, float scroll, float repeat)
public static void DrawLineTextured(Vector2i p0, Vector2i p1, int thickness, PackedSpriteID spriteID, float scroll, float repeat)
public static void DrawLineTextured(Vector2i p0, Vector2i p1, PackedSpriteID spriteID, float scroll, float repeat)
public static void DrawLineTextured(Vector2i p0, Vector2i p1, int thickness, PackedSprite sprite, float scroll, float repeat)
public static void DrawLineTextured(Vector2i p0, Vector2i p1, PackedSprite sprite, float scroll, float repeat)

Parameters

p0 Vector2i One end of the line
p1 Vector2i The other end of the line
thickness int Thickness of the line in pixels
srcRect Rect2i Rectangular texture region to use from current sprite sheet
scroll float Scrolls the sprite horizontally by the given amount
repeat float Repeat the sprite texture the given amount of time across the length of the line
spriteIndex int The sprite index to use from the current sprite sheet
spriteName string The sprite name to use from the current sprite sheet
spriteID PackedSpriteID The sprite ID to use
sprite PackedSprite The sprite to use

Returns

Nothing.

Description

Draw a line from point p0 to point p1 with the specified sprite. The sprite should be aligned horizontally in your sprite sheet.

Example

void Render() {
    PackedSprite laserSprite = RB.PackedSpriteGet("laser");

    Vector2i lineStart = new Vector2i(10050);
    Vector2i lineEnd = new Vector2i(15075);
    float len = (lineEnd - lineStart).Magnitude();

    float repeats = len / (float)laserSprite.Size.width;
    float scroll = Time.realtimeSinceStartup;

    RB.DrawLineTextured(lineStart, lineEnd, laserSprite, scroll, repeats));
}