Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign up- Add option to scale Ninepatch #1801
Conversation
|
Duplicated issue |
|
This also means we avoid a few multiplies for each draw. |
|
Thanks Nate, that solves the problem in a much more elegant way. Maybe, as a suggestion, we could add a setScale(float scale) method to NinePatch to provide an easy way to apply a change to all sizes. Usually NinePatch regions will be generated by an Atlas and the size of the regions may be unknow so, intead of writing:
we can just call
|
|
Done! Forgot to link the commit. |
dylanritter
commented
Feb 9, 2015
|
Hi, is there a convenient way to set a ninepatch scale without having to manually construct and then pass in the drawable to an actor ? For example, when creating a TextButton it's very convenient to specify a style name and then leave it at that, however with the 'setScale' method on the ninepatch itself it seems that it would require instantiating each of the possible drawables (up, down, etc.) and scaling those then setting them up in the button, thus destroying the elegance of using the style in the TextButton constructor. I guess what i'm looking for is that the setScale method on the button instance would apply itself to the backgrounds in the style being used. so something like this: TextButton btn = new TextButton("title", myStyle); While we are here, i haven't found any effect of using the setScale method on an actor, everything seems to draw at the same size regardless and have always had to resort to manually scaling actors in setSize or .width().height() when using a table. Thank you, Dylan |
|
This is an issue tracker, IRC or the forums are more appropriate for questions. |
dylanritter
commented
Feb 9, 2015
|
Thank you for your reply. I have further questions on this so will go to the forums as you suggest. |
obigu commentedMay 4, 2014
See #1800