Gideros AceSlide class creates a sliding element to switch different objects. Great for providing and input to choose levels or packages in mobile games.
You can navigate through objects by using provided function or allowing users to drag and drop to switch content.
Package contains AceSlide.lua and example Gideros application project.
--initialize slider
local slider = AceSlide.new({
orientation = "horizontal",
spacing = 100,
speed = 5,
unfocusedAlpha = 0.75,
easing = nil,
allowDrag = true,
dragOffset = 10
})
stage:addChild(slider)
--create 10 boxes
for i = 1, 10 do
local box = Bitmap.new(Texture.new("images/crate.png"))
slider:add(box)
end
--just to show as example
--of modifying all elements
slider:applyToAll(function(elem)
elem:setScale(2)
end)
--display slider
slider:show()