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

Add a layer between Corona and the game #42

Open
aurelien-defossez opened this issue Sep 23, 2012 · 0 comments
Open

Add a layer between Corona and the game #42

aurelien-defossez opened this issue Sep 23, 2012 · 0 comments
Assignees
Milestone

Comments

@aurelien-defossez
Copy link
Owner

Add a layer to create a more flexible API.

e.g. instead of
self.xpCounter = display.newText(self.player.xp, 0, 0, native.systemFontBold, 32)
self.xpCounter:setReferencePoint(display.MiddleCenterReferencePoint)
self.xpCounter:rotate(self.player.direction)
self.xpCounter.x = self.width / 2
self.xpCounter.y = self.height / 2
self.xpCounter:setTextColor(0, 0, 0)
self.group:insert(self.xpCounter)

Do something like
createText{
text = self.player.xp,
size = 32,
reference = display.MiddleCenterReferencePoint,
x = self.width / 2,
y = self.height / 2,
group = self.group
}

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