Difference between revisions of "love.scene"
(Created page with "== 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 gra...") |
(→Documentation and source code) |
||
Line 40: | Line 40: | ||
{{#set:LOVE Version=11.3+}} | {{#set:LOVE Version=11.3+}} | ||
{{#set:Description=Small scene graph library written for the LÖVE framework using pure Lua}} | {{#set:Description=Small scene graph library written for the LÖVE framework using pure Lua}} | ||
− | {{#set:Keyword= | + | {{#set:Keyword=Framework}} |
[[Category:Libraries]] | [[Category:Libraries]] | ||
== Other Languages == | == Other Languages == | ||
{{i18n|profile}} | {{i18n|profile}} |
Revision as of 09:10, 9 October 2024
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