Flaxis / slick-ui

Lightweight Phaser UI plugin
http://slick-ui.com/
190 stars 25 forks source link

Added TextButton element #7

Closed WrinklyDog closed 8 years ago

Flaxis commented 8 years ago

How would this be better than adding a SlickUI.Element.Text object to a SlickUI.Element.Button object (as seen here)?

WrinklyDog commented 8 years ago

In parts of my game I don't want the actual button image. I could add a SlickUI.Element.Text object to a SlickUI.Element.Button with a transparent button image but then I couldn't use the regular button. I would also have to add the text tint change on every button I created.

Flaxis commented 8 years ago

It sounds like you'd be better off forking the project then. We can't include code in the library that only facilitates specific situations. I did intend to write separate renderers for things such as buttons, panels etc. so maybe you'd be interested in that. I'll start working on that right now actually :)

Flaxis commented 8 years ago

Finished moving render responsibilities into separate objects. Maybe it interests you, because it gives you full control over rendering buttons. All you have to do, is reference it in your theme like this:

  "renderer": {
    "button": "Your.Namespace.Here.ButtonRenderer"
  },

You can refer to the default ButtonRenderer to find out how to make your own renderer.

See: 6b78e9df92336e0f3a93444f4b2ebc7590834846

I hope this helps you out! Unfortunately I can't merge your PR.