UnderwaterApps / overlap2d

Overlap2D Game development toolkit for UI and Level design
Other
781 stars 224 forks source link

9patch usage in O2D? #426

Closed Bassofia closed 7 years ago

Bassofia commented 7 years ago

Hello there,

I used the "built-in" 9patch O2D plugin to create a 9patch item but I'm unsure about some things.

Can I use the 9patch inside O2D? Like, create a button with the parts of the 9patch item? If I can, how?

Or do I must handle the 9patch via libgdx code?

Thanks in advance

Bassofia commented 7 years ago

Nevermind, now the problem is the 9patch works only for the original resolution, if I set up a different resolution the base image gets added to the atlas/packs but just as an image, not as a 9patch, causing O2D to crash if I open the other resolution and throwing a "nullPointer" on my game.

Bassofia commented 7 years ago

Using O2D included 9patch won't work for other resolutions. To fix this you must create the 9patch externally then import the 9patch file into O2D, this will create the 9patch in the correct size for all resolutions.

Tool for 9patchs online that works.

https://romannurik.github.io/AndroidAssetStudio/nine-patches.html#&sourceDensity=320&name=example