Hi guys,
today I tried one of the examples to render a isometric map. I painted an own using "tiled" and replaced the one in the example with the new one. Problem is that the map will be rendered as a complete black surface. After playing arround I don't get any further. Any quick idea? Must be something stupid.
today I tried one of the examples to render a isometric map. I painted an own using "tiled" and replaced the one in the example with the new one. Problem is that the map will be rendered as a complete black surface. After playing arround I don't get any further. Any quick idea? Must be something stupid.
B4X:
Sub LG_Create
'Loads the isometric map (TMX format)
Dim TMXLoader As lgMapTmxMapLoader
TiledMap = TMXLoader.Initialize2("maps/tmx/isometric/Map.tmx")
'Logs some information about this map
Log("--------")
Log("Map properties:")
Dim lstProperties As List = TiledMap.Properties.GetAllKeys
For i = 0 To lstProperties.Size - 1
Dim obj As Object = TiledMap.Properties.Get(lstProperties.Get(i))
Log("- " & lstProperties.Get(i) & "=" & obj)
Next
Log("- nb. of layers=" & TiledMap.Layers.Count)
Dim lstTilesets As List = TiledMap.TileSets.GetAllTilesets
Log("- nb. of tilesets=" & lstTilesets.Size)
Log("--------")
Log("Layer properties:")
Dim FirstLayer As lgMapTiledMapLayer = TiledMap.Layers.Get(0)
Log("- name=" & FirstLayer.Name)
Log("- nb. of objects=" & FirstLayer.Objects.Count)
Log("--------")
Log("Tileset properties:")
Dim FirstTileset As lgMapTiledMapSet = lstTilesets.Get(0)
Log("- name=" & FirstTileset.Name)
lstProperties = FirstTileset.Properties.GetAllKeys
For i = 0 To lstProperties.Size - 1
Dim obj As Object = FirstTileset.Properties.Get(lstProperties.Get(i))
Log("- " & lstProperties.Get(i) & "=" & obj)
Next
Log("- size=" & FirstTileset.Size)
Log("--------")
'Initializes the renderer
Renderer.Initialize3(TiledMap, 1/32)
End Sub
Sub LG_Resize(Width As Int, Height As Int)
'Sets the camera viewport
Camera.Initialize
Camera.SetToOrtho2(False, (Width / Height) * 15, 15)
Camera.Position.Set(13, 0, 0)
End Sub
Sub LG_Render
'Clears the screen
GL.glClearColor(0.55, 0.55, 0.55, 1)
GL.glClear(GL.GL10_COLOR_BUFFER_BIT)
'Updates the matrices of the camera
Camera.Update
Renderer.SetCameraView(Camera)
'Draws the tiled map
Renderer.Render
End Sub