Page 1 of 1

Can't display TiledLayer...

Posted: Thu Sep 04, 2008 11:42 pm
by Jeireff
Can some one please explain me to use TiledLayer from Libwiisprite?
I've tested and tested and can't display the TiledLayer.

I have a Image with a height of 48 an width of 96
I just want to split it up into two images a 48x48
and diplay just the fist of the both.

Later, if a special WPAD Event is fired, i want to change
the images.

Here is what I have now. But it doesn't work...

Code: Select all

  Image      test;
  if(test.LoadImage(DATAPATH "gewehr_zielen.png") != IMG_LOAD_ERROR_NONE)exit(0);

  TiledLayer ourTileObject(2, 1, 2);
  ourTileObject.SetStaticTileset(&test, 48, 48);
  ourTileObject.SetCell(1,1,1);
  ourTileObject.FillCells(1,1,1,1,1);
  ourTileObject.SetPosition(100,100);
  ourTileObject.Draw(0,0);
Can anybody help me?
THX :D

Re: Can't display TiledLayer...

Posted: Mon Sep 08, 2008 12:16 am
by Jeireff
Okay Okay....
I' just a stupid idiot. :D
It's so simple... ^^

In this way it have to work ^^

Code: Select all

  Image      test;
  if(test.LoadImage(DATAPATH "gewehr_zielen.png") != IMG_LOAD_ERROR_NONE)exit(0);

  TiledLayer ourTileObject(1, 1, 2);
  ourTileObject.SetStaticTileset(&test, 48, 48);
  ourTileObject.SetCell(0,0,1);
  ourTileObject.SetPosition(100,100);
  ourTileObject.Draw(0,0);
So i would say:
/closed

Greetz