raylibRenderer

package
v0.0.0-...-126e10b Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2024 License: MIT Imports: 15 Imported by: 0

README

Template service

The purpose of this Service Mesh service is ...

Dependencies

This service has dependencies on all other Diablo2 file-loader services:

Integration with other services

This service integrates with the following services:

  • buzz

  • quzz

  • describe where the integration is optonal or not ...


This service exports an integration interface IsFoo with an alias Dependencncy which are intended to be used by other services for dependency resolution (see servicemesh.HasDependencies), and expose just the methods which other services should use.

type Dependency = Foo

type IsFoo interface {
    Foo()
}

Lua service integration

Describe how this service integrates with the lua service (this is just an example).

You should show an example of the lua API usage:

data = assets.load("/data/global/ui/Loading/loadingscreen.dc6")

Documentation

Index

Constants

View Source
const DefaultCameraName = ""

Variables

This section is empty.

Functions

This section is empty.

Types

type Dependency

type Dependency = IsRenderer

type IsRenderer

type IsRenderer interface {
	IsInit() bool
	ManagesWindow
	ManagesCameras
	ProvidesTextures
	ProvidesRenderables
}

type ManagesCameras

type ManagesCameras interface {
	GetDefaultCamera() *rl.Camera2D
	AddCamera(name string) *rl.Camera2D
	GetCamera(name string) *rl.Camera2D
	RemoveCamera(name string)
}

type ManagesWindow

type ManagesWindow interface {
	SetWindowTitle(string)
	WindowSize() (width, height int)
	Resolution() (width, height int)
}

type ProvidesRenderables

type ProvidesRenderables interface {
	NewRenderable() Renderable
}

type ProvidesTextures

type ProvidesTextures interface {
	GetTexture(uuid.UUID, image.Image) (texture rl.Texture2D, isNew bool)
}

type Renderable

type Renderable interface {
	UUID() uuid.UUID
	Destory()

	ZIndex() float32
	SetZIndex(float32)

	Position() (x, y float32)
	SetPosition(x, y float32)

	Rotation() (degrees float32)
	SetRotation(degrees float32)

	Scale() (scale float32)
	SetScale(scale float32)

	Opacity() (opacity float32)
	SetOpacity(opacity float32)

	BlendMode() (mode rl.BlendMode)
	SetBlendMode(mode rl.BlendMode)

	Texture() rl.Texture2D
	SetTexture(rl.Texture2D)

	Image() image.Image
	SetImage(image.Image)

	Enable()
	Disable()
	IsEnabled() bool
	// contains filtered or unexported methods
}

Renderable is a thing that the renderer provides to other services, which encapsulates the necessary behavior of something that can be rendered

type Service

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

func (*Service) AddCamera

func (s *Service) AddCamera(name string) *rl.Camera2D

func (*Service) CacheBudget

func (s *Service) CacheBudget() int

func (*Service) ConfigFileName

func (s *Service) ConfigFileName() string

func (*Service) DefaultConfig

func (s *Service) DefaultConfig() (cfg configFile.Config)

func (*Service) ExportToLua

func (s *Service) ExportToLua(state *lua.LState)

func (*Service) FlushCache

func (s *Service) FlushCache(newCache *cache.Cache)

func (*Service) GetCamera

func (s *Service) GetCamera(name string) *rl.Camera2D

func (*Service) GetDefaultCamera

func (s *Service) GetDefaultCamera() *rl.Camera2D

func (*Service) GetTexture

func (s *Service) GetTexture(uuid uuid.UUID, img image.Image) (texture rl.Texture2D, isNew bool)

func (*Service) Init

func (s *Service) Init(mesh servicemesh.Mesh)

func (*Service) IsInit

func (s *Service) IsInit() bool

func (*Service) LoadConfig

func (s *Service) LoadConfig(config *configFile.Config)

func (*Service) Logger

func (s *Service) Logger() *slog.Logger

func (*Service) Name

func (s *Service) Name() string

func (*Service) NewRenderable

func (s *Service) NewRenderable() Renderable

func (*Service) Ready

func (s *Service) Ready() bool

func (*Service) RemoveCamera

func (s *Service) RemoveCamera(name string)

func (*Service) Resolution

func (s *Service) Resolution() (width, height int)

func (*Service) SetLogger

func (s *Service) SetLogger(logger *slog.Logger)

func (*Service) SetWindowTitle

func (s *Service) SetWindowTitle(title string)

func (*Service) UnexportFromLua

func (s *Service) UnexportFromLua(state *lua.LState)

func (*Service) WindowSize

func (s *Service) WindowSize() (width, height int)

Jump to

Keyboard shortcuts

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