Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: create item carrousel #67

Open
RodrigoDornelles opened this issue Sep 12, 2024 · 0 comments
Open

feat: create item carrousel #67

RodrigoDornelles opened this issue Sep 12, 2024 · 0 comments
Labels
Core Team responsibility for project maintainers. difficulty: expert require low level experiencie

Comments

@RodrigoDornelles
Copy link
Member

example

local function draw(std, game)
    std.ui.carrosel({
        x=0, y=0,
        height=100
        item_padding=32,
        item_width=game.width/8
        item_select=game.menu_item_y
        selected=function(std.game.ui)
            std.draw.color(std.color.white)
            std.draw.rect(1, 0, 0, std.ui.width * std.math.cos(std.milis), std.ui.height * std.math.cos(std.milis))
        end,
        items={
            function(std, game)
                std.draw.color(std.color.red)
                std.draw.rect(0, 0, 0, std.ui.width, std.ui.height)
            end,
            function(std, game)
                std.draw.color(std.color.green)
                std.draw.rect(0, 0, 0, std.ui.width, std.ui.height)
            end,
            function(std, game)
                std.draw.color(std.color.blue)
                std.draw.rect(0, 0, 0, std.ui.width, std.ui.height)
            end,
            function(std, game)
                std.draw.color(std.color.yellow)
                std.draw.rect(0, 0, 0, std.ui.width, std.ui.height)
            end,
            function(std, game)
                std.draw.color(std.color.orange)
                std.draw.rect(0, 0, 0, std.ui.width, std.ui.height)
            end
        }
    })
end
@RodrigoDornelles RodrigoDornelles added this to the 0.0.6 milestone Sep 12, 2024
@RodrigoDornelles RodrigoDornelles added difficulty: expert require low level experiencie Core Team responsibility for project maintainers. labels Sep 12, 2024
@RodrigoDornelles RodrigoDornelles removed this from the 0.0.6 milestone Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core Team responsibility for project maintainers. difficulty: expert require low level experiencie
Projects
None yet
Development

No branches or pull requests

1 participant