screen

package
v0.0.0-...-9794d0e Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CL_NONE   = 0
	CL_GROUND = 0x484445
	CL_SKY    = 0x6C696A
	CL_BLACK  = 0x2c3531
	CL_WHITE  = 0xF0F0F0
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Console

type Console struct {
	Screen tcell.Screen
	// contains filtered or unexported fields
}

Console represents symbols screen buffer (where each pixel is symbol)

func (*Console) Clear

func (scr *Console) Clear() error

Clear clears the screen

func (Console) Height

func (scr Console) Height() int

Height get current screen height

func (Console) NewScreen

func (scr Console) NewScreen(w, h int) (Screen, error)

NewScreen empty screen initializer with buffer of empty pixels

func (*Console) Render

func (scr *Console) Render() error

Render renders screen to console

func (*Console) SetKeyboardHandler

func (scr *Console) SetKeyboardHandler(call func(int, bool))

SetKeyboardHandler sets handler function for input listening

func (*Console) SetPixel

func (scr *Console) SetPixel(x, y int, color uint32) error

SetPixel puts a pixel on screen

func (Console) Width

func (scr Console) Width() int

Width get current screen width

type DummyScreen

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

DummyScreen with no functionality for debug purposes

func (*DummyScreen) Clear

func (scr *DummyScreen) Clear() error

Clear clears the screen

func (DummyScreen) Height

func (scr DummyScreen) Height() int

Height get current screen height

func (DummyScreen) NewScreen

func (scr DummyScreen) NewScreen(w, h int) (Screen, error)

NewScreen empty screen initializer with buffer of empty pixels

func (*DummyScreen) Render

func (scr *DummyScreen) Render() error

Render renders screen content

func (*DummyScreen) SetKeyboardHandler

func (scr *DummyScreen) SetKeyboardHandler(call func(int, bool))

SetKeyboardHandler sets handler function for input listening

func (*DummyScreen) SetPixel

func (scr *DummyScreen) SetPixel(x, y int, symbol uint32) error

SetPixel puts a pixel on screen

func (DummyScreen) Width

func (scr DummyScreen) Width() int

Width get current screen width

type Screen

type Screen interface {
	NewScreen(w, h int) (Screen, error)
	SetPixel(x, y int, pixel uint32) error
	Render() error
	Clear() error
	Height() int
	Width() int
	SetKeyboardHandler(func(int, bool))
}

Screen represents screen buffer

type Sdl2

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

Sdl2 screen represents sdl2 window screen

func (*Sdl2) Clear

func (scr *Sdl2) Clear() error

Clear clears the screen

func (Sdl2) Height

func (scr Sdl2) Height() int

Height get current screen height

func (Sdl2) NewScreen

func (scr Sdl2) NewScreen(w, h int) (Screen, error)

NewScreen empty screen initializer with buffer of empty pixels

func (*Sdl2) Render

func (scr *Sdl2) Render() error

Render renders screen to sdl window

func (*Sdl2) SetKeyboardHandler

func (scr *Sdl2) SetKeyboardHandler(call func(int, bool))

SetKeyboardHandler sets handler function for input listening

func (*Sdl2) SetPixel

func (scr *Sdl2) SetPixel(x, y int, color uint32) error

SetPixel puts a pixel in the screen buffer

func (Sdl2) Width

func (scr Sdl2) Width() int

Width get current screen width

Jump to

Keyboard shortcuts

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