Hello Guest

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - MindJuiceKen

Pages: [1]
1
Support / Objects in Tile Maps?
« on: January 23, 2014, 07:14:03 am »
I want to have a level-designer/artist work on creating my map(s) using Tiled, and I would like them to be able to position objects in the scene using Tiled's object layers.

Do you have any plan to extend 2D Toolkit to expose TMX object information?  I really only need to be able to access the XML data, but it would be cool if that was mapped to a dictionary for easy lookup instead of ugly XML parsing methods.

Something like this:
  • Get a list of ObjectLayers from the tile map object
  • ObjectLayers have a list of MapObjects.
  • MapObjects have information about their type (rectangle, ellipse, etc.), and a dictionary/map of key/value pairs entered from Tiled.

Also, the ability to replace an object with a prefab (the way you allow with tiles) would be great.

I'd be willing to help out with this if you're interested in including it.

2
Support / Loading PNGs from byte array
« on: March 03, 2012, 02:08:46 am »
I have a project where I need to do the following:
  • Load a ZIP file using the WWW class
  • Unzip the PNG files contained in the ZIP into byte arrays (one per image)
  • Create a 2D UI object that is based on that PNG image data

Ideally, I could keep this all in memory rather than saving the PNG out to a file first.  The code might look something like this:

  // Pseudo-code for Zip reading
  byte[] data = myZipFile.sizeInBytes(filenameToUnzip);
  bool result = myZipFile.read(filenameToUnzip, data);
  // Create an object to use with 2D Toolkit (not sure what name your class would be)
  Sprite s = Sprite.create(data);


If there was no other way, it would also be OK to create the image from a PNG file.  In that case, I would unzip the PNGs into byte arrays and save them to the local file system.

  Sprite s = Sprite.loadFromZip("myFile.zip");

Even more ideally, I could call a method like this and it would load an image directly from the ZIP file itself:

  String pathToTheFileToReadFrom = "Folder/SomeFilename.png";
  Sprite s = Sprite.createFromZip("myFile.zip", pathToTheFileToReadFrom);


Is this possible with 2DToolkit now?  In the future?

Thanks!

Ken

Pages: [1]