The documentation for the Tilemap class is like this:
setData ( width height data )
Where data is "The one dimensional array for the map data"
I'm having troubles figuring out what one dimensional array is expecting, so far I have my code like this:
var actor = new Tilemap();
actor.setData(576, 384, ImageManager.loadCharacter("Actor1"));
actor.tileHeight = 48;
actor.tileWidth = 48;
actor.update();
When I'm trying to get the length of the actor.bitmaps it returns 0, what am I doing wrong?
I figured out the data attribute is just an id and a number like 1 : 512 inside a ".data()" and the data attribute is just a parameter to check the type of tile from a predefined list, from here to create a custom tilemap I would need to add some extra code to the list of predefined tiles. So the image goes into the bitmaps attribute once everything is setup. However I couldn't figure a way to slice the image with this class so I think for my purpose it might be better to use PIXI directly. Maybe this class is just to organize tiles, I don't really know.
Hope this helps someone that gets stuck here like I did.
mmm ... not sure what you're saying here.
The data attribute comes from $dataMap and it is the width x height x 6 (?) that contains all the tile ids, shadows, and flags for the entire map.
Tilemap is for drawing the map. It has nothing to do with drawing actors (at least from what I recall when I looked into it last). You are doing something very weird here. Perhaps you should take a big step back, and state what you are trying to do, because the above is not the way to go about it.
Oh I see, thank you for your answer. I'm trying to create custom size tilesets to create an animation plugin for the Medieval Interior assets that are 128,128 each tile, I couldn't find the class the actors use to slice and store the tiles for the animations.
My progress on this is that I'm using PIXI to do it. The only problem I'm currently facing is that the PIXI that comes with a new project doesn't come with the PIXI.loaders to preload the images so I'm worried about the performance.
If there is a plugin that I'm missing that already do this or any advice, I will really appreciate it, I bought rpg maker 4 days ago so I am a little bit lose.
I'm a little lost, are you trying to change the cell size? I mean the tile data is getting the width/height of each cell and the tile_map of the room.
Not really change the cell size, the characters are normally 48,48 but the Medieval Interior characters are 128,128, so rpg maker doesn't slice the character sheets to create event animations like a kneel animation, I tried with "more character frames" plugin but I only managed to get the walking animations.
I found the solution I was looking for, after doing some more research, the "Sprite()" class from rpg maker has the frame function from pixi.
I really need to read a little bit more of the documentation.
I am still confused.
The Medieval pack is from PV Games, correct? The tiles are all 32x32 for Ace and 48x48 for MV.
I think what you're talking about is characters, not tiles - in the img/characters folder. Those are not drawn on the map. They are placed with events. And they animate by you adding move routes or turning on stepping animation.
You should not have to change any scripts in order to use those, and if you do, the script mods should be provided as part of the package.
Thank you Shaz. The Quasi Sprite on that thread fix my issue and is very easy to setup.