renderer

package
v0.0.0-...-1c1542d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 23, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PalletIndexToColor

func PalletIndexToColor(index int) rl.Color

PalletIndexToColor converts a pallet index to a color.

It takes the index of the color in the pallet. Returns the corresponding color.

Types

type Renderer

type Renderer struct {
	Target *rl.RenderTexture2D
}

func NewRenderer

func NewRenderer(gameWidth, gameHeight int, title string) *Renderer

NewRenderer creates a new renderer for the game.

It takes the game width, game height, and title as parameters. Returns a pointer to the renderer.

func (*Renderer) Close

func (r *Renderer) Close()

Close releases the render texture and closes the window.

No parameters. No return types.

func (*Renderer) DrawCircle

func (r *Renderer) DrawCircle(x, y, radius int, color int)

DrawCircle draws a circle in the texture.

It takes the x, y, and radius as parameters. No return types.

func (*Renderer) DrawCircleLines

func (r *Renderer) DrawCircleLines(x, y, radius int, color int)

DrawCircleLines draws a circle in the texture.

It takes the x, y, and radius as parameters. No return types.

func (*Renderer) DrawLine

func (r *Renderer) DrawLine(x1, y1, x2, y2 int, color int)

DrawLine draws a line in the texture.

It takes the x1, y1, x2, y2, and color as parameters. No return types.

func (*Renderer) DrawOnScreen

func (r *Renderer) DrawOnScreen()

DrawOnScreen draws the renderer on the screen.

No parameters. No return types.

func (*Renderer) DrawPixel

func (r *Renderer) DrawPixel(x, y int, color int)

DrawPixel draws a pixel in the texture.

It takes the x, y, and color as parameters. No return types.

func (*Renderer) DrawRectangle

func (r *Renderer) DrawRectangle(x, y, width, height int, color int)

DrawRectangle draws a rectangle in the texture.

It takes the x, y, width, height, and color as parameters. No return types.

func (*Renderer) DrawRectangleLines

func (r *Renderer) DrawRectangleLines(x, y, width, height int, color int)

DrawRectangleLines draws a rectangle in the texture.

It takes the x, y, width, height, and color as parameters. No return types.

func (*Renderer) DrawSprite

func (r *Renderer) DrawSprite(x, y int, spr *sprite.Sprite)

DrawSprite draws a sprite in the texture.

It takes the x, y, and the sprite as parameters. No return types.

func (*Renderer) DrawText

func (r *Renderer) DrawText(f *font.Font, x, y int, text string)

func (*Renderer) DrawTriangle

func (r *Renderer) DrawTriangle(x1, y1, x2, y2, x3, y3 int, color int)

DrawTriangle draws a triangle in the texture.

It takes the x1, y1, x2, y2, x3, y3, and color as parameters. No return types.

func (*Renderer) DrawTriangleLines

func (r *Renderer) DrawTriangleLines(x1, y1, x2, y2, x3, y3 int, color int)

DrawTriangle draws a triangle in the texture.

It takes the x1, y1, x2, y2, x3, y3, and color as parameters. No return types.

func (*Renderer) Fill

func (r *Renderer) Fill(color int)

Fill fills the screen with a color.

It takes the color as a parameter. No return types.

func (*Renderer) StartDrawing

func (r *Renderer) StartDrawing()

StartDrawing is a function that starts the drawing process.

No parameters. No return types.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL