Problem with isometric view

176 views
Skip to first unread message

dearth....@gmail.com

unread,
Jul 16, 2012, 5:27:04 PM7/16/12
to mel...@googlegroups.com
Hello !

I've a problem with melonjs, i've made a map with tiled map editor in isometric view ( base64 not compressed ), but canvas  didn't like that :

   In tiled map editor, It's that I want to get http://d25.e-loader.net/U41kaEGSo3.png
   and with melonjs I've two problems : the first is a problem with the height and the width of the game, my map makes of 1200 pixels on of 660 pixels (Width : 11 / Height : 13) but same if I set the width and the height to 1200 on 660 I've an error who said "[22:56:11,625] uncaught exception: melonJS: map size should be at least equal to the defined display size" and "--[23:07:06,661] IndexSizeError: Index or size is negative or greater than the allowed amount @ http://127.0.0.1:8080/jeu/assets/js/melonjs-0.9.3.js:153"
 So what size I put ?

  my second problem is surely due to the size of my tiles ( width: 110 px / height : 65 px ) and this is what I get with canvas 640 to 480 requires,  http://d14.e-loader.net/vClmhSfkK0.png
  I get a stairs of tiles :/ and I don't know how to resolve that.

Sorry for my bad english, I'm a young french developer and it's difficult for me to inform me on a recently web framework as MelonJs.

 best regards.

melonJS

unread,
Jul 16, 2012, 10:23:24 PM7/16/12
to mel...@googlegroups.com
Salut !

Well isometric support is not yet perfect in melonJS, they are still some bugs here and there, and some helper functions are not yet there.

first of all, could you try with the last 0.9.4 ?
it's not however yet a public version, and if you cannot build it out of github, you can find a temporary version here :

About the size issue, what is your tile width/height ? If I divide 1200 by 11, it's giving me an odd 109,09... for the tilewidth 
And don't worry about the english, I'm french too anyway :)

Regards,
Olivier.

Gumcher

unread,
Jul 17, 2012, 5:50:40 AM7/17/12
to mel...@googlegroups.com
Thank you for the very fast response !
 I don't use the 0.9.4 version, but the 0.9.3, it's maybe that ?
 Now I use the 0.9.4 ?

 About the size issue, this is my tmx file :


<?xml version="1.0" encoding="UTF-8"?>
<map version="1.0" orientation="isometric" width="11" height="13" tilewidth="100" tileheight="55">
 <tileset firstgid="1" name="tuile" tilewidth="100" tileheight="55">
  <image source="tuile.png" width="200" height="55"/>
 </tileset>
 <layer name="Calque de Tile 1" width="11" height="13">
  <data encoding="base64">
   AQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAACAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAIAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAA=
  </data>
 </layer>
</map>


Sorry but I don't understand what to do for know the correct size of the canvas element :/.

Best regards.
--------------------

Merci pour la réponse rapide
 Je n'utilise pas la version 0.9.4 mais la 0.9.3, c'est peut être du à ça ?


<?xml version="1.0" encoding="UTF-8"?>
<map version="1.0" orientation="isometric" width="11" height="13" tilewidth="100" tileheight="55">
 <tileset firstgid="1" name="tuile" tilewidth="100" tileheight="55">
  <image source="tuile.png" width="200" height="55"/>
 </tileset>
 <layer name="Calque de Tile 1" width="11" height="13">
  <data encoding="base64">
   AQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAACAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAIAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAA=
  </data>
 </layer>
</map>

Désolé mais je n'ai pas très bien compris ce qu'il fallait faire pour connaître la bonne taille :/
N'y a t-il pas moyen de mettre une taille plus grande que la taille de la carte ?

Cordialement.

melonJS

unread,
Jul 17, 2012, 6:04:37 AM7/17/12
to mel...@googlegroups.com

I believe the current code check for the minimum canvas size by doing :

11 * 100 : 1100

13 * 55    :   715 

So the canvas should be of maximum 1100 * 715, anyway  I would recommend lower the size until you see it’s working J


But yes, this is a current limitation that need to be fixed :

https://github.com/obiot/melonJS/issues/33

Gumcher

unread,
Jul 17, 2012, 6:18:50 AM7/17/12
to mel...@googlegroups.com
I resolve my first issue to passing in 0.9.4 thank you very much !

Okay I understand now ! and my problem is resolve too in 1100*715 !
But my canvas kept the melonjs logo in background, it's normal ?

 Thank you for the help =) and great framework !

melonJS

unread,
Jul 17, 2012, 6:23:27 AM7/17/12
to mel...@googlegroups.com

good !

for the logo, it's because you have not define any background color.
Go to Tiled, map properties, and add a "background_color" property with a value in the #hhhhhh format.

melonJS

unread,
Jul 17, 2012, 6:25:42 AM7/17/12
to mel...@googlegroups.com

 Thank you for the help =) and great framework ! 

merci et bievenue d'ailleurs ! :)
Reply all
Reply to author
Forward
0 new messages