-
Notifications
You must be signed in to change notification settings - Fork 41
Flower Extensions
makoto edited this page Jun 30, 2013
·
3 revisions
It is a module that extends the Flower Library.
This provides a powerful several modules.
- Tiled. Module for using the Tiled Map Editor.
- Widget. Widget module that is simple and easy to use.
- Audio. Audio library that can be used for simple.
A library for using Tiled Map Editor.(Support Version: 0.9.0)
It is the simplest way.
tiled = require "tiled"
function onCreate(e)
layer = flower.Layer()
layer:setScene(scene)
layer:setSortMode(MOAILayer.SORT_PRIORITY_ASCENDING)
tileMap = tiled.TileMap()
tileMap:loadLueFile("platform.lue")
tileMap:setLayer(layer)
end
It is possible to use Isometric.
Designed to reduce the drawing.
When using a single tileset, and perform only once drawn.
Design for easy expansion.
Easy to inherited class, switching is simple.
Widget library that can be used for simple.
Example of some components are as follows.
widget = require "widget"
function onCreate(e)
view = widget.UIView {
scene = scene
}
button = widget.Button {
size = {200, 50},
pos = {10, 10},
text = "Test1",
parent = view,
onClick = button_OnClick,
onDown = button_OnDown,
onUp = button_OnUp,
}
checkbox = widget.CheckBox {
pos = {10, 70},
size = {300, 40},
parent = view,
text = "メッセージ",
selected = true,
onSelectedChanged = function(e)
print("checkbox1 selected changed:", e.target:isSelected())
end,
}
textInput = widget.TextInput {
size = {200, 50},
pos = {10, 120},
parent = view,
}
joystick = widget.Joystick {
pos = {10, 180},
stickMode = "analog",
parent = view,
onStickChanged = joystick_OnStickChanged,
}
end
Can be freely set the Theme.
Audio library that can be used for simple.
local audio = require "audio"
audio.init()
--- play sound
audio.play("sample_sound.wav")
-- pause sound
audio.pause("sample_sound.wav")
-- stop sound
audio.stop("sample_sound.wav")