2D Sprites and 9-slicing

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!

5 Likes

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

OH YES!! :smiley: finally :slight_smile:

1 Like

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

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?

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?

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.

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

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

1 Like

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

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.

2 Likes

Hi there,

slicing’s a great feature! If it’s really released, can you tell us how to create a new Sprite Asset? I cannot see it under the “add asset” menu.

Right click on a texture to create a texture atlas. From there you can either use the sprite editor to create a sprite asset or right click on the texture atlas to create a sprite asset.

1 Like