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

Custom data properties for elements #43

Open
exerro opened this issue Feb 18, 2017 · 0 comments
Open

Custom data properties for elements #43

exerro opened this issue Feb 18, 2017 · 0 comments

Comments

@exerro
Copy link
Owner

exerro commented Feb 18, 2017

Being able to give individual elements custom data properties would be useful. For example:

local button = container + sheets.Button( 0, 0, 20, 5, "Hello!" )

button:add_data( "t", sheets.Type.primitive.number, 0 )
button:add_data( "r", sheets.Type.primitive.number, 0 )

button:set {
    x = "r + r * sin( t )";
    y = "r + r * cos( t )";
}

function button:on_update( dt )
	self:set_t( self.t + dt )
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant