SiliconGhetto Engine API
    Preparing search index...

    Function drawRect

    • Draw a filled rectangle.

      Parameters

      • x: number

        X position of the top-left corner

      • y: number

        Y position of the top-left corner

      • w: number

        Width in pixels

      • h: number

        Height in pixels

      • opts: DrawOpts = {}

        Color and alpha options (r, g, b, a each 0-1)

      Returns void

      sg.drawRect(10, 10, 100, 50, { r: 1, g: 0, b: 0 }); // red rectangle