2D Sprites and 9-slicing


#1

We’re excited to launch our new 2D engine features.

sprite-game

As of now the Sprite Component, Sprite Asset and Texture Atlas Asset are available for all users.

These features can be used to create classic style 2D games, try combining with our P2 physics plugin for 2D graphics and physics!

Also landing today is 9-slicing. 9-sliced sprites (also call 9-patch sprites) are a great way to build scalable user interfaces using textures. The idea is to divide an image into 9 areas which each scale in a different way as you resize them. Check out the image below to see how it let’s you resize buttons and other UI elements cleanly.

button-9

Drop your questions and feedback in this thread!


Testing Sprites and Checkpoints
#2

Congratulations on the addition… will vector/svg graphics be supported?


#3

OH YES!! :smiley: finally :slight_smile:


#4

Unfortunately, we don’t currently have plans to support vector or SVG graphics.


#5

Hello,

I am new to the forums and Play Canvas.
I need to ask is there any thing else coming down the line for 2D support in play canvas?


#6

Hi,
I have a problem with Sprite’s Draw Order.
User Manual Say:
The order in which this sprite is rendered. Lower numbers are rendered first.

Now I have a two sprite call A & B.
I want B render first so i set A’s Draw Order to 1 and B’s Draw Order to 0.
I think the result maybe like that:

And this is my setting:

But when i launch project the result is:


I’m feel confusion…,is i missing something?


#7

For sprites to render in draw order they must be in a layer that is set to Manual Sort Mode.

The default latlyer they are added to is World which is sort by depth order.


#8

How do I get a working p2? It doesn’t work for me?


#9

Check this post for the fix: [SOLVED] Accessing p2.js physics objects in script


#10

Thanks yaustar! How come Playcanvas’ devs not updating anything. No updated tutorial…


#11

It’s a personal project of Will’s rather than a official supported library or tutorial.

Currently the developers are working on asset bundles and more version control like features from what I read on GitHub and the forums.