Documentation
¶
Overview ¶
Package ebitenbackend implements the render package's backend interfaces (Canvas, FontFace, Image and Driver) on top of EBiten. It is the only package in the framework that imports EBiten; everything above it depends solely on the render and geom packages.
Index ¶
- func DefaultFont(size float64) render.FontFace
- func LoadImageBytes(data []byte) (render.Image, error)
- func New() render.Driver
- func NewFontFace(ttf []byte, size float64) (render.FontFace, error)
- func NewImage(img *ebiten.Image) render.Image
- func NewRenderTarget(width, height int) render.RenderTarget
- type Driver
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultFont ¶
DefaultFont returns the bundled Go font at the given size as a render.FontFace. It panics only if the embedded font asset fails to parse, which would be a build-time corruption rather than a runtime condition.
func LoadImageBytes ¶
LoadImageBytes decodes PNG/JPEG/GIF data into a render.Image.
func NewFontFace ¶
NewFontFace parses a TrueType/OpenType font from ttf and returns a render.FontFace at the given size.
func NewRenderTarget ¶
func NewRenderTarget(width, height int) render.RenderTarget
NewRenderTarget allocates an offscreen drawable surface of the given pixel size. It returns nil for non-positive dimensions.
Types ¶
type Driver ¶
type Driver struct{}
Driver implements render.Driver on top of EBiten. Construct one with New and hand it to the framework's App; the framework never touches EBiten directly.
func (*Driver) Run ¶
Run configures the host window and runs the EBiten game loop, invoking the framework's hooks each frame. It blocks until the window closes or a hook returns an error.
func (*Driver) SetCloseHandled ¶
SetCloseHandled satisfies render.CloseInterceptor. With it on, EBiten stops closing the window itself and reports the request through IsWindowBeingClosed, which Update turns into the framework's CloseRequested hook. EBiten accepts this before RunGame as well as during the loop, and it is a no-op off the desktop.
func (*Driver) SetIMEEnabled ¶
SetIMEEnabled and SetIMERect satisfy render.IMEController. EBiten (v2.9.9) exposes no API to toggle the IME or position the candidate window, and does not surface preedit text, so these are no-ops today: only committed IME text flows (via AppendInputChars in pollInput). The methods exist so the framework can light up IME support once a backend provides it, without API churn above.