Hello Guest

Author Topic: Getting a triangular shape from atlas  (Read 4236 times)

ivomarel

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 13
    • View Profile
Getting a triangular shape from atlas
« on: June 13, 2013, 02:48:21 am »
Hey guys,

I am currently working with a map, with triangular corners and a tiled center. I am using 2DToolkit to create the atlas for me and (as expected) it saves the four corners next to each other, all as if they were four rectangles (please see attachment). Is there any way to save this in a different way and save half the space? I was thinking to use shaders, but I work for mobile device and I am not sure if that would work.

Would be easiest if I can get a triangular shape out of the atlas instead of a rectangle.

One solution I have - if I get the shapes in the atlas they way I want, I can just load the two rectangles twice and make the tiles overlap them. I am just wondering if there are other / better ways to do this.

Edit: And obviously it's easy to get the shapes in the atlas, I just put them together as one image..
Cheers,

Ivo
« Last Edit: June 13, 2013, 02:53:43 am by ivomarel »

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Getting a triangular shape from atlas
« Reply #1 on: June 13, 2013, 10:17:59 am »
Yup. You can do that + use the custom mesh feature to get the triangles. You can add the same image multiple times - there is no issue in doing that. (it only gets added once into the atlas)

ivomarel

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: Getting a triangular shape from atlas
« Reply #2 on: June 19, 2013, 11:54:23 am »
Forgot to say thanks before - this worked perfectly.

The custom mesh looked strange (did not match 100% with the preview in the 2D toolkit window) in the beginning, but I fixed it by setting Trimming to false.

Cheers!