sprites

package
v0.24.2 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ActionNonPCAttack  = 2
	ActionNonPCHurt    = 3
	ActionNonPCDeath   = 4
	ActionNonPCPerf1   = 5
	ActionNonPCPerf2   = 6
	ActionNonPCPerf3   = 7
	ActionNonPCSpecial = 8
	ActionPCReadyFight = 4
	ActionPCAttack1    = 5
	ActionPCHurt       = 6
	ActionPCDeath      = 8
	ActionPCFreeze2    = 9
	ActionPCAttack2    = 10
	ActionPCAttack3    = 11
	ActionPCSkill      = 12
)

Variables

This section is empty.

Functions

func AttackActionFamily

func AttackActionFamily(manager *res.Manager, actor world.Actor) int

func BillboardForState

func BillboardForState(view *scene.SpriteView, state State, now time.Time) (*scene.Billboard, bool)

func BodyMotionForState

func BodyMotionForState(action res.ACTAction, state State, started time.Time, now time.Time) int

func CursorFrameBillboard

func CursorFrameBillboard(view *scene.SpriteView, actionIndex, motion int, anchorX, anchorY float64) (*scene.Billboard, bool)

func DirectionForCamera

func DirectionForCamera(direction int, cameraYaw float64) int

func DrawAnimation

func DrawAnimation(target *render.Image, view *scene.SpriteView, anim res.ACTAnimation, anchorX, anchorY float64, posX, posY int32) bool

func DrawFixedShadow3D

func DrawFixedShadow3D(screen *render.Frame, projection scene.Projection, view *scene.SpriteView, worldX, worldY, worldZ, scale float64, alpha float64, shadow float64) bool

func DrawOverlay3D

func DrawOverlay3D(screen *render.Frame, projection scene.Projection, billboard *scene.Billboard, worldX, worldY, worldZ, scale float64, alpha float64, shadow float64, tintColor color.RGBA)

func DrawShadow3D

func DrawShadow3D(screen *render.Frame, projection scene.Projection, billboard *scene.Billboard, worldX, worldY, worldZ, scale float64, alpha float64, shadow float64) bool

func FixedBillboard

func FixedBillboard(view *scene.SpriteView) (*scene.Billboard, bool)

func HumanoidBillboard

func HumanoidBillboard(view *Humanoid, state State, now time.Time) (*scene.Billboard, bool)

func JobHasNoSprite

func JobHasNoSprite(job int) bool

func LoadCart

func LoadCart(manager *res.Manager, cartNum int) (*scene.SpriteView, string)

func LoadCursor

func LoadCursor(manager *res.Manager) (*scene.SpriteView, string)

func LoadFalcon

func LoadFalcon(manager *res.Manager, job int) (*scene.SpriteView, string)

func LoadNonPC

func LoadNonPC(manager *res.Manager, job int, label string) (*scene.SpriteView, string)

func LoadPetAccessory

func LoadPetAccessory(manager *res.Manager, base *scene.SpriteView, accessoryID uint32, label string) (*scene.SpriteView, string)

func LoadShadow

func LoadShadow(manager *res.Manager) (*scene.SpriteView, string)

func MotionIndex

func MotionIndex(action res.ACTAction, started time.Time, now time.Time, loop bool) int

func ResolveAction

func ResolveAction(act *res.ACT, actionFamily, direction int) (int, res.ACTAction, bool)

Types

type Appearance

type Appearance struct {
	Job         int
	Head        int
	Sex         byte
	Admin       bool
	BodyPalette int
	HeadPalette int
	Weapon      int
	Shield      int
	HeadTop     int
	HeadMid     int
	HeadLow     int
}

func MercenaryAppearanceForActor

func MercenaryAppearanceForActor(actor worldstate.Actor) Appearance

type Humanoid

type Humanoid struct {
	Body *scene.SpriteView

	Started time.Time
	// contains filtered or unexported fields
}

func LoadHumanoid

func LoadHumanoid(manager *res.Manager, appearance Appearance, label string) (*Humanoid, string)

func LoadMercenary

func LoadMercenary(manager *res.Manager, appearance Appearance, label string) (*Humanoid, string)

func LoadPlayer

func LoadPlayer(manager *res.Manager, character session.Character, sex byte, admin bool) (*Humanoid, string)

type State

type State struct {
	SeparateEquipment bool

	ActionFamily   int
	Direction      int
	HeadDir        uint8
	HeadTurn       bool
	CameraYaw      float64
	Moving         bool
	Started        time.Time
	Loop           bool
	PingPong       bool
	LoopIdle       bool
	Play           bool
	HasPlay        bool
	Length         int
	HasLength      bool
	FrameOffset    int
	HasFrameOffset bool
	FixedMotion    int
	HasFixedMotion bool
	Speed          time.Duration
	HasSpeed       bool
	MoveSpeedMS    int
	WalkDistance   float64
}

type Upscaler

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

Sprite frames arrive during play. One worker and a bounded queue keep xBR off the render thread; a busy queue leaves the original visible until a later draw can enqueue it. The cache shares results across actors and anchor offsets.

func NewUpscaler

func NewUpscaler() *Upscaler

func (*Upscaler) Close

func (s *Upscaler) Close()

Close stops taking work. The owner releases images already adopted by Texture.

func (*Upscaler) Texture

func (s *Upscaler) Texture(src *render.Image, adopt func(*render.Image) *render.Image) *render.Image

Texture returns the original until the worker finishes. adopt registers a completed image with its owner on the game/render thread.

Jump to

Keyboard shortcuts

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