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

Extract position-setting into a callback function #32

Closed
shippy opened this issue Mar 17, 2017 · 1 comment
Closed

Extract position-setting into a callback function #32

shippy opened this issue Mar 17, 2017 · 1 comment

Comments

@shippy
Copy link
Contributor

shippy commented Mar 17, 2017

The reason position isn't set in config is that for many objects, their position is a function of (a) screen width and height, (b) other objects. For those, however, the computation is deterministic.

settings.object.X.posFn could be the standard place for an object to save the requisite function handle in.

The standard format is function XPos(ScreenWidth, ScreenHeight [, settings.objects]) -> rect, where rect is a 4x1 matrix. If the format is kept constant, this will enable other functions to extract other object positions without necessarily knowing what their specific position-calculating function is, simply by calling settings.object.X.posFn.

@shippy
Copy link
Contributor Author

shippy commented Mar 17, 2017

offCenterByPx can handle a lot; users can make their draw scripts a function of other things. This is too much complexity for too little help.

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