love.scene
love.scene
love.scene is a two-dimensional scene graph library written for the LÖVE game framework (compatible with LÖVE 11.3, 11.4 and 11.5). To install the scene graph, copy the "scene" folder to your game directory and use require:
love.scene = require("scene")
Usage
The scene graph is fairly minimal, relying on just four different types of objects. Scene nodes are created using two different methods:
local view = love.scene.newView()
-- object-oriented style
local s1 = view:newSprite(0, 0)
-- Love2D style
local s2 = love.scene.newSprite(0, 0)
s2:setParent(view)
Images, text and other types of drawable graphics are rendered as follows:
-- image
local image = love.graphics.newImage("mytexture.png")
s1:setGraphic(image)
-- text
local font = love.graphics.getFont()
local text = love.graphics.newText(font, "Hello world")
s2:setGraphic(text)
function love.draw()
view:draw()
end
Documentation and source code
https://github.com/2dengine/love.scene
https://2dengine.com/doc/scene.html
Other Languages
Dansk –
Deutsch –
English –
Español –
Français –
Indonesia –
Italiano –
Lietuviškai –
Magyar –
Nederlands –
Polski –
Português –
Română –
Slovenský –
Suomi –
Svenska –
Türkçe –
Česky –
Ελληνικά –
Български –
Русский –
Српски –
Українська –
עברית –
ไทย –
日本語 –
正體中文 –
简体中文 –
Tiếng Việt –
한국어
More info