scenes

package
v0.0.0-...-a545287 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2022 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const CloudyDay1 = "cloudy-day-1"
View Source
const CloudyDay2 = "cloudy-day-2"
View Source
const CloudyDay3 = "cloudy-day-3"
View Source
const Day = "day"
View Source
const FrameDurationInNanos = 33333333 // 30 FPS approximated in nanos
View Source
const Night = "night"
View Source
const Rainy = "rainy"
View Source
const UpdateDurationInNanos = 10000000 // 100 updates per second (to maintain physics & time), independent from FPS

Variables

This section is empty.

Functions

func Demos

func Demos(c Canvas, done chan struct{}, keyboardChannel *controller.KeyboardEventChannel)

Types

type ByNextAnniversary

type ByNextAnniversary []Person

ByNextAnniversary implements sort.Interface based on the Birthday field.

func (ByNextAnniversary) Len

func (a ByNextAnniversary) Len() int

func (ByNextAnniversary) Less

func (a ByNextAnniversary) Less(i, j int) bool

func (ByNextAnniversary) Swap

func (a ByNextAnniversary) Swap(i, j int)

type Engine

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

func NewEngine

func NewEngine(canvas canvas.Canvas, scenes []*Scene) Engine

func (*Engine) Run

func (e *Engine) Run(done chan struct{})

type Focus

type Focus struct {
}

func NewFocusComponent

func NewFocusComponent(canvas canvas.Canvas) *Focus

func (Focus) Draw

func (f Focus) Draw(canvas canvas.Canvas) error

func (Focus) Update

func (f Focus) Update(elapsedBetweenUpdate time.Duration) bool

type GamePadDemo

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

func NewGamePadDemoComponent

func NewGamePadDemoComponent(canvas Canvas) *GamePadDemo

func (*GamePadDemo) Controller

func (f *GamePadDemo) Controller() SceneController

func (*GamePadDemo) Draw

func (f *GamePadDemo) Draw(canvas Canvas) error

func (*GamePadDemo) Update

func (f *GamePadDemo) Update(elapsedBetweenUpdate time.Duration) bool

type GamepadDemoController

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

func NewGamepadDemoController

func NewGamepadDemoController(bounds image.Rectangle, positionable canvas.Positionable) *GamepadDemoController

func (*GamepadDemoController) HandleGamepadEvent

func (c *GamepadDemoController) HandleGamepadEvent(event *controller.GamepadEvent, projection *controller.GamepadProjection)

func (*GamepadDemoController) HandleKeyboardEvent

func (c *GamepadDemoController) HandleKeyboardEvent(event *controller.KeyboardEvent, projection *controller.KeyboardProjection)

func (*GamepadDemoController) Update

func (c *GamepadDemoController) Update(elapsedBetweenUpdate time.Duration) bool

type MeteoCurrent

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

func NewMeteoCurrentComponent

func NewMeteoCurrentComponent(_ Canvas, insee string) *MeteoCurrent

func (*MeteoCurrent) Draw

func (m *MeteoCurrent) Draw(canvas Canvas) error

func (*MeteoCurrent) Update

func (m *MeteoCurrent) Update(_ time.Duration) bool

type MeteoCurrentData

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

type MeteoForecast

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

func NewMeteoForecastComponent

func NewMeteoForecastComponent(canvas Canvas, insee string) *MeteoForecast

func (*MeteoForecast) Draw

func (m *MeteoForecast) Draw(canvas Canvas) error

func (*MeteoForecast) Update

func (m *MeteoForecast) Update(elapsedBetweenUpdate time.Duration) bool

type MeteoForecastDailyData

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

type MeteoForecastData

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

type NextAnniversaries

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

func NewNextAnniversariesComponent

func NewNextAnniversariesComponent(canvas Canvas) *NextAnniversaries

func (NextAnniversaries) Draw

func (na NextAnniversaries) Draw(canvas Canvas) error

func (*NextAnniversaries) Update

func (na *NextAnniversaries) Update(elapsedBetweenUpdate time.Duration) bool

type Person

type Person struct {
	Name     string
	Birthday time.Time
}

type Photo

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

func NewPhotoComponent

func NewPhotoComponent(canvas Canvas) *Photo

func (Photo) Draw

func (p Photo) Draw(canvas Canvas) error

func (*Photo) Update

func (p *Photo) Update(elapsedBetweenUpdate time.Duration) bool

type PhotoGallery

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

func NewPhotoGalleryComponent

func NewPhotoGalleryComponent(_ Canvas) *PhotoGallery

func (PhotoGallery) Draw

func (p PhotoGallery) Draw(canvas Canvas) error

func (*PhotoGallery) Update

func (p *PhotoGallery) Update(elapsedBetweenUpdate time.Duration) bool

type Scene

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

func NewScene

func NewScene(components []components.Component, duration time.Duration) *Scene

func (*Scene) GamepadControl

func (s *Scene) GamepadControl(gamepad *controller.Gamepad)

func (*Scene) KeyboardControl

func (s *Scene) KeyboardControl(keyboard *controller.Keyboard)

func (*Scene) Render

func (s *Scene) Render(canvas canvas.Canvas) error

func (*Scene) Update

func (s *Scene) Update(elapsedBetweenUpdate time.Duration) bool

func (*Scene) WithController

func (s *Scene) WithController(controller SceneController) *Scene

func (*Scene) WithEffect

func (s *Scene) WithEffect(effect effect.DynamicEffect) *Scene

func (*Scene) WithEffects

func (s *Scene) WithEffects(effects []effect.DynamicEffect) *Scene

type SceneController

type SceneController interface {
	HandleGamepadEvent(event *controller.GamepadEvent, projection *controller.GamepadProjection)
	HandleKeyboardEvent(event *controller.KeyboardEvent, projection *controller.KeyboardProjection)
}

Jump to

Keyboard shortcuts

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