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

Rect2i.Expand

Method

public Rect2i Expand(int amount)
public Rect2i Expand(int widthAmount, int heightAmount)

Parameters

amount int Amount to expand by
widthAmount int Width to expand by
heightAmount int Height to expand by

Returns

Rect2i

The expanded Rect

Description

Expand the rectangular area vertically and horizontally by the given amount. Positive values will grow the rectangle, and negative values will shrink it.

Example

void Render() {
    // Draw progressively smaller rectangles
    var rect = new Rect2i(00RB.DisplaySize.width, RB.DisplaySize.height);
    for (int i = 0; i < 8; i++) {
        RB.DrawRect(rect, Color.white);
        rect.Expand(-4);
    }