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.


Messages - MindJuiceKen

Pages: [1]
1
Support / Re: Objects in Tile Maps?
« on: January 25, 2014, 07:04:00 am »
Thanks for the reply.

There are plenty of game engines with full TMX support, so the overhead can't be so significant that it's not worth doing.

Plus it's something that you could only include if they user chose to.  If you need it, you pay the cost.

Another option would be to import the TMX files in the editor and convert them into your internal tile map format.

That way, we could have artists use Tiled to create game levels, then import them into Unity/tk2d and avoid any additional overhead of XML parsing, Base64 or ZIP.

It would need to be easy to refresh the tile map if the TMX was modified (ideally automatically, but on demand would be okay).

Anyway, just some thoughts.


2
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.

3
Support / Re: Loading PNGs from byte array
« on: March 05, 2012, 02:52:06 am »
Understood.  Just to be clear, you said "create a sprite collection from a texture".  The "texture" I have in this case is the PNG itself, not decoded into an in-memory texture.

I know the WWW class can return a file as a texture, so the ability must be there under the covers, but I haven't found a method to create a texture from a byte array.

Do you know if that exists?

4
Support / Re: Loading PNGs from byte array
« on: March 04, 2012, 04:56:41 am »
I am creating a separate (non-Unity-based) product that will allow my customers to generate "project" ZIP files that will contain various configuration files and data displays.

The project will be loaded over the network by a Unity-based app that I am working on now.

Many of the data displays are made up of one or more PNG images (e.g., up and down image for button, background for a numeric display).

As far as I understand, Asset Bundles are not an option because they must be built with Unity, and my customers will only have my app, not Unity.

For now, at least, loading images and displaying them is enough.  Performance on an iPad or Tegra-based tablet should be more than enough to handle the extra draw calls for our use case.

In the near future, it would also be possible for me to combine images into an atlas file with a PNG and corresponding data file if that is something that could be handled too.

Thanks!


Ken

5
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]