roguepixel

package
v0.0.0-...-7004f9a Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Camera

type Camera struct {
	Position pixel.Vec
	Zoom     float64
	// contains filtered or unexported fields
}

Camera controls camera position in a pixel window.

func NewCamera

func NewCamera(tileWidth, tileHeight, mapWidth, mapHeight, viewportWidth, viewportHeight int) *Camera

NewCamera returns a new camera instance for a pixel window.

func (*Camera) Move

func (c *Camera) Move(x, y int)

Move moves the position of the camera.

func (*Camera) SetZoom

func (c *Camera) SetZoom(amount float64)

SetZoom zooms the camera. 1.0 is 100%.

type GridRenderOptions

type GridRenderOptions struct {
	// Font settings.
	FontFacePath string
	FontSize     int

	// Tiling settings.
	TileWidth  int
	TileHeight int

	// Window-related settings.
	WindowTitle string
	WindowSizeX int
	WindowSizeY int

	MapWidth  int
	MapHeight int

	// Advanced Settings
	SmoothDrawing bool
	VSync         bool
}

type GridRenderer

type GridRenderer struct {
	Window *pixelgl.Window
	// contains filtered or unexported fields
}

GridRenderer abstracts a pixel-powered grid renderer.

func NewRenderer

func NewRenderer(opt GridRenderOptions) (*GridRenderer, error)

NewRenderer initializes and returns a new pixel renderer in the specified window.

func (*GridRenderer) Clear

func (r *GridRenderer) Clear()

func (*GridRenderer) Draw

func (r *GridRenderer) Draw()

func (*GridRenderer) GetCamera

func (r *GridRenderer) GetCamera() *Camera

func (*GridRenderer) Rectangle

func (r *GridRenderer) Rectangle(x, y int, bgColor color.Color)

func (*GridRenderer) Running

func (r *GridRenderer) Running() bool

func (*GridRenderer) Text

func (r *GridRenderer) Text(x, y int, text string, fgColor color.Color)

type InputHandler

type InputHandler struct {
	// contains filtered or unexported fields
}

InputHandler handles input using pixel.

func NewInputHandler

func NewInputHandler(win *pixelgl.Window) *InputHandler

func (*InputHandler) AutoExploreTriggered

func (i *InputHandler) AutoExploreTriggered() bool

func (*InputHandler) GetDirection

func (i *InputHandler) GetDirection() cartography.Direction

func (*InputHandler) RepeatModeTriggered

func (i *InputHandler) RepeatModeTriggered() bool

RepeatModeTriggered returns if repeat mode was triggered.

Jump to

Keyboard shortcuts

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