component

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ActiveOptionIndicator = donburi.NewTag()

	Dialog          = donburi.NewTag()
	DialogCamera    = donburi.NewTag()
	DialogLog       = donburi.NewTag()
	DialogLogCamera = donburi.NewTag()

	RecentParagraph = donburi.NewTag()

	// InnerCamera means the camera is placed inside another camera.
	InnerCamera = donburi.NewTag()

	LevelCamera = donburi.NewTag()
	Character   = donburi.NewTag()

	Inventory = donburi.NewTag()

	ActivePOI = donburi.NewTag()
	POIImage  = donburi.NewTag()
)

Functions

func Destroy

func Destroy(e *donburi.Entry)

Types

type ActiveData

type ActiveData struct {
	Active bool
}

func (*ActiveData) Toggle

func (a *ActiveData) Toggle()

type AlphaOverride

type AlphaOverride struct {
	A float64
}

type Animation

type Animation struct {
	Active         bool
	Timer          *engine.Timer
	Update         func(e *donburi.Entry, a *Animation)
	OnStart        func(e *donburi.Entry)
	OnStartOneShot []func(e *donburi.Entry)
	OnStop         func(e *donburi.Entry)
	OnStopOneShot  []func(e *donburi.Entry)
}

func (*Animation) Start

func (a *Animation) Start(e *donburi.Entry)

func (*Animation) Stop

func (a *Animation) Stop(e *donburi.Entry)

type AnimatorData

type AnimatorData struct {
	Animations map[string]*Animation
}

func (*AnimatorData) SetAnimation

func (a *AnimatorData) SetAnimation(name string, anim *Animation)

func (*AnimatorData) Start

func (a *AnimatorData) Start(name string, e *donburi.Entry)

func (*AnimatorData) Stop

func (a *AnimatorData) Stop(name string, e *donburi.Entry)

type BoundsData

type BoundsData struct {
	Width  float64
	Height float64
}

func (BoundsData) Rect

func (d BoundsData) Rect(e *donburi.Entry) engine.Rect

type BriefZoomData

type BriefZoomData struct {
	OriginCamera *CameraData
}

type CameraData

type CameraData struct {
	Viewport         *ebiten.Image
	ViewportPosition math.Vec2
	ViewportZoom     float64
	ViewportTarget   *donburi.Entry
	ViewportBounds   ViewportBounds

	Root  *donburi.Entry
	Index int
	Mask  *ebiten.Image

	TransitionOverlay *ebiten.Image
	TransitionAlpha   float64

	ColorOverride *ColorOverride
	AlphaOverride *AlphaOverride
}

func (CameraData) Order

func (d CameraData) Order() int

func (*CameraData) SetViewportPosition

func (d *CameraData) SetViewportPosition(pos math.Vec2)

func (*CameraData) WorldPositionToViewportPosition

func (d *CameraData) WorldPositionToViewportPosition(e *donburi.Entry) math.Vec2

type ColliderData

type ColliderData struct {
	Rect  engine.Rect
	Layer domain.ColliderLayer

	CollidesWith           map[CollisionKey]Collision
	JustCollidedWith       map[CollisionKey]struct{}
	JustOutOfCollisionWith map[CollisionKey]struct{}
}

type Collision

type Collision struct {
	TimesSeen int
	Detected  bool
}

type CollisionKey

type CollisionKey struct {
	Layer domain.ColliderLayer
	Other donburi.Entity
}

type ColorBlendOverride

type ColorBlendOverride struct {
	// Value is in range [0, 1]
	// 0 is monochrome, 1 is the original color
	Value float64
}

type ColorOverride

type ColorOverride struct {
	R, G, B float64
}

type Debug

type Debug struct {
	Enabled   bool
	UIHovered bool
}

type DebugUIData

type DebugUIData struct {
	UI *ebitenui.UI
}

type DestroyedData

type DestroyedData struct{}

type DialogOptionData

type DialogOptionData struct {
	Index int
	Lines int
}

func (DialogOptionData) Order

func (d DialogOptionData) Order() int

type Dimensions

type Dimensions struct {
	Updated bool

	ScreenWidth  int
	ScreenHeight int

	InventoryWidth int

	DialogWidth            int
	DialogLogHeight        int
	DialogOptionsHeight    int
	DialogOptionsRowHeight int
}

type GameData

type GameData struct {
	Story *domain.Story

	// Can be saved to go "back" to the previous level, keeping the player's position
	PreviousLevel *PreviousLevel

	Dimensions Dimensions

	Debug Debug

	SwitchToTitle func()
}

func MustFindGame

func MustFindGame(w donburi.World) *GameData

type InputData

type InputData struct {
	Disabled bool

	MoveRightKeys []ebiten.Key
	MoveLeftKeys  []ebiten.Key
	ActionKeys    []ebiten.Key

	MoveSpeed float64
	ShootKey  ebiten.Key
}

type LayerData

type LayerData struct {
	Layer domain.LayerID
}

type LevelData

type LevelData struct {
	Name     string
	Changing bool
}

type MovementBoundsData

type MovementBoundsData struct {
	Range engine.FloatRange
}

type POIData

type POIData struct {
	POI          domain.POI
	ParentObject *donburi.Entry
}

type ParticleData

type ParticleData struct {
	Life    int
	MaxLife int
	Size    float64
	Color   color.RGBA
}

type PassageData

type PassageData struct {
	Passage      *domain.Passage
	ActiveOption int
	Height       float64
}

type PreviousLevel

type PreviousLevel struct {
	Name              string
	CharacterPosition *domain.CharacterPosition
}

type SpriteData

type SpriteData struct {
	Image *ebiten.Image
	Pivot SpritePivot

	// The original rotation of the sprite
	// "Facing right" is considered 0 degrees
	OriginalRotation float64

	FlipY bool

	Hidden bool

	ColorOverride      *ColorOverride
	AlphaOverride      *AlphaOverride
	ColorBlendOverride *ColorBlendOverride
}

func (*SpriteData) Hide

func (s *SpriteData) Hide()

func (*SpriteData) Show

func (s *SpriteData) Show()

type SpritePivot

type SpritePivot int
const (
	SpritePivotTopLeft SpritePivot = iota
	SpritePivotCenter
)

type StackedViewData

type StackedViewData struct {
	CurrentY float64
	Scrolled bool
}

type TagData

type TagData struct {
	// Used for debugging
	Tag string
}

type TextData

type TextData struct {
	Text  string
	Color color.Color
	Size  TextSize

	Align text.Align

	Hidden bool

	Streaming      bool
	StreamingTimer *engine.Timer

	AlphaOverride *AlphaOverride
}

type TextSize

type TextSize int
const (
	TextSizeM TextSize = iota
	TextSizeS
	TextSizeL
)

type TimeToLiveData

type TimeToLiveData struct {
	Timer *engine.Timer
}

type VelocityData

type VelocityData struct {
	Velocity         math.Vec2
	RotationVelocity float64
}

type ViewportBounds

type ViewportBounds struct {
	X *engine.FloatRange
	Y *engine.FloatRange
}

Jump to

Keyboard shortcuts

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