Informatix, I believe it is working now. I forgot to turn off debug mode on the last compile
Thank you SOOOOOOOOOO much.
Thank you SOOOOOOOOOO much.
I don't know what's the best solution in this case. Usually, the platform games with a side scrolling have various landscapes so there's no need for repeated tiles. And the never-ending-scrolling techniques are for textures, not tiles. If you find something that works fine, let us know.Informatix. Here's something to chew on:
As the camera moves up the map, eventually the map end, and the Pacdroid moves into blackness (no background map.) Maps are always located with the lower left corner at (0,0). What I'd like to do is place another map and the end of the first one, and repeat this over and over, kind of like and endless runner type game.
Do you have any thoughts on how to achieve this?
import com.badlogic.gdx.maps.tiled.TiledMapTile; import com.badlogic.gdx.maps.tiled.TiledMapTileLayer; import com.badlogic.gdx.maps.tiled.TiledMapTileLayer.Cell; import com.badlogic.gdx.maps.tiled.TiledMapTileSet; import com.badlogic.gdx.maps.tiled.TiledMapTileSets;
Maybe your brilliant brain can figure it out.Essentially that uses a TiledMap subclass that adds positioning, and a custom renderer that takes the map positioning into account when drawing the tiles. As it is intended to be an "endless runner", it reuses two map instances and swaps between them, regenerating each map "section" as it is swapped in.
That looks good.
My skull contains more mud than brain actually.Maybe your brilliant brain can figure it out.
If I remember correctly, it's some code to move the camera in the test apps. It's not a part of the lib and you can do the same thing with B4A (e.g. with the gesture detector).I can't find OrthoCamController I assumed it would have been lgOrthoCamController
Look at my Animation demo and my Map_Hexagonal demo. I show two ways to get arrays from a split.TextureRegion splitTiles = TextureRegion.split(tiles, 32, 32)
I don't know what to do following the "=" as TextureRegion is not a variable
lgMapTiledMapSets (note the final s)map1.getTileSets().addTileSet(tileset)
The closest I could get is : map1.TileSets.getTileSet. (and then there is no option for addTileSet)
Yes, forget. It calls the constructor of the ancestor of the class (you don't need to bother with that in general with B4A).super(map)
Not sure what super is, but it's probably not a libGDX thing
No, to map.Layers. When a library is wrapped, usually the get and set are removed and the two functions become a single property in B4A.map.getLayers()
Am I assuming correctly that this translate to map.Layers.GetAllLayers?
Great.I hope to have this working over the weekend. I'll share it with everyone, as it might be of some use.
Parsing code. 0.00
Compiling code. 0.03
Compiling layouts code. 0.00
Generating R file. Error
AndroidManifest.xml:17: error: No resource identifier found for attribute 'hardwareAccelerated' in package 'android'
Again, I hope you have or have had a great vacation. I'm in sunny California now, but will be in sub-zero temps in New England for the holidays.'Class module
Dim vertices(20) As Float
Dim thisMap As TiledMapEx
Dim Batch As lgSpriteBatch
'Initializes the object. You can add parameters to this method if needed.
Public Sub Initialize(vMap As TiledMapEx)
thisMap = vMap
Public Sub renderObject(vObject As lgMapObject) '#1 this doesn't seem to be used but it was in the original code
Public Sub renderTileLayer(vlayer As lgMapTiledMapLayer)
Dim rendMap As TiledMapEx = (TiledMapEx) getMap() '#2 I don't know what to make of this Java code. I assume that it gets a map bu treats it like the class of TiledMapEx instead of TileMap. I don't know how to change an object's class if that is the case, an what map is it getting? I assume it's something.Map or something.getMap
Dim Color As Float = Color.toFloatBits(1, 1, 1, vlayer.getOpacity) '#3 I know there is an lgCOlor, but it doesn't have "toFloatBits" as a method
Dim layerWidth As Int = vlayer.Width
Dim layerHeight As Int = vlayer.Height
Dim layerTileWidth As Float = vlayer.TileWidth * unitScale '#4 I know this should be renderer.unitScale, but the renderer is in another class. Do I need to pass it when initializing this class?
Dim layerTileHeight As Float = vlayer.TileHeight * unitScale
Dim col1 As Int = Max(0, (Int) ((viewBounds.x - rendMap.x) / layerTileWidth))
Dim col2 As Int = Min(layerWidth, (Int) (((viewBounds.x - rendMap.x) + viewBounds.width + layerTileWidth) / layerTileWidth)) '#5 Same as the unitScale issue, I guess
Dim row1 As Int = Max(0, (Int) ((viewBounds.y - rendMap.y) / layerTileHeight))
Dim row2 As Int = Min(layerHeight, (Int) (((viewBounds.y - rendMap.y) + viewBounds.height + layerTileHeight) / layerTileHeight))
Dim y As Float = row1 * layerTileHeight + rendMap.y
Dim xStart = col1 * layerTileWidth + rendMap.x
Dim vertices() As Float = this.vertices '#6 This doesn't seem to make sense to me I know b4a doesn't have "this" but also, vertices is a global array. Why's it being Dimmed again, and without the definition for the number of elements?
Dim x1 As Float = x
Dim y1 As Float = y
Dim x2 As Float = x1 + region.RegionWidth * unitScale
Dim y2 As Float = y1 + region.RegionHeight * unitScale
Dim u1 As Float = region.U
Dim v1 As Float = region.v2
Dim u2 As Float = region.u2
Dim v2 As Float = region.V
vertices(x1) = x1
vertices(y1) = y1
vertices(C1) = Color '#7 This is never declared. Perhaps there's some internal Java thing that allows it to appear out of nowhere
vertices(u1) = u1
vertices(v1) = v1
vertices(x2) = x1
vertices(y2) = y2
vertices(C2) = Color '#8 From here on down is probably the same issue as above
vertices(u2) = u1
vertices(v2) = v2
vertices(x3) = x2
vertices(y3) = y2
vertices(C3) = Color
vertices(u3) = u2
vertices(v3) = v2
In the Basic4Android IDE, go to “Tools/Configure Paths”. Be sure the android.jar is set to version 11 or higher (this setting is important to compile successfully but has no influence on the Android version required by your application, which is set in the manifest by minSdkVersion, so you can select the latest Jar present in your Android SDK folder).Thanks Informatix for the great lib and examples..
I go this error message in ALL of the examples:
Now that I looked closely to the code of the example, I realize that it is not easy to port to B4A (you have to extend another class, which is impossible, and not extending it complicates a lot your work). I planned for the beginning of 2014 to update my code to the version 0.9.9 of libGDX. I will provide you a solution to endlessly scroll a map at this moment. I hope you can wait a few weeks.Informatix,
I finished porting the runnerExample.Java code. I can't run it yet because there are a few things I still can't find:
For starters, this is suppose to be an extension BatchSpriteMapRenderer, So I think I've not set up my globals and initialized properly
Again, I hope you have or have had a great vacation. I'm in sunny California now, but will be in sub-zero temps in New England for the holidays.
P.S. I don't know why the code didn't retain it's indent formatting
You rock. Yes, I can wait. I can work on other aspects of the mechanics, and if I run out of things to do, or just become stumped, I'll work on graphic design, plus I'll be spending a lot of time with my family anyway.I will provide you a solution to endlessly scroll a map at this moment. I hope you can wait a few weeks.
That was a big mistake of mine, and was against my responsible of being accurate. Neutrality is"hardwareAccelerated" is not in all examples. Only a few.
What you're trying to do is not really clear to me. You can place a libGDX view inside a panel, of course, but you cannot add this view in your designer. It has been done programmatically.Informatix,
Sorry but I utterly failed to add views to the activity by creating a .bal file in designer. no errors but the
app ran normally with no button shown on the screen.. Can these examples run inside a panel?
Thanks in advance
Yes, I left La Reunion a few days before a cyclone strikes it. I just had news from my family on the island and they are out of danger now.I hope you had a great vacation!
Great news! I'm working too with libGDX currently.You'd be stunned by the progress I've made with your lib. Of course, I still struggle, but I think I'm days away from an alpha release of my app.
To be honest, I didn't test at all the lgMapPolylineMapObject class so I'm afraid that I'm of no help. I suppose that you get a polyline with one of the functions of this class and you can get its vertices with the getVertices function of the lgMathPolyline class.Right now, I am stumbling over one issue. I used the application Tiled to create a map and some polyline objects. I want to read the polylines and use their vertices to create a BOX2D edge, but I can't figure out how to access this information from the tiled map object. I can see the object layer, but not sure how to get its vertices.