tile

Java - Creating a 2D tile map in a panel using Graphics2D Rectangles?

只愿长相守 提交于 2019-12-03 00:52:14
I'm trying to simulate a battle in a really basic program, but since this is my first time with a big program in Java I'm pretty much clueless on how to proceed. I was thinking I'd have a big 600-by-600 panel and use Graphics2D to just draw the terrain as 20x20 rectangles... Unfortunately even with several tutorials I have no idea what to do. I have 10 different types of terrain to cycle through, and 5 different landscape profiles. Basically what I want the program to do is when I select a certain profile in a combobox, it paints the landscape and the two opposing sides in the battle (though I

render a tile map using javascript

我是研究僧i 提交于 2019-12-02 17:43:05
I'm looking for a logical understanding with sample implementation ideas on taking a tilemap such as this: http://thorsummoner.github.io/old-html-tabletop-test/pallete/tilesets/fullmap/scbw_tiles.png And rendering in a logical way such as this: http://thorsummoner.github.io/old-html-tabletop-test/ I see all of the tiles are there, but I don't understand how they are placed in a way that forms shapes. My understanding of rendering tiles so far is simple, and very manual. Loop through map array, where there are numbers (1, 2, 3, whatever), render that specified tile. var mapArray = [ [0, 0, 0, 0

Convert a single large image overlay to tiles for Google Maps

百般思念 提交于 2019-12-02 16:50:43
I have a large high-resolution image that I am using for an overlay using Google Maps v3 API. This works fine for desktop and laptop computers with a reasonable network connection, but unsurprisingly it does not work so well for mobile users. What's the best/easiest way to break the image up into 2D tiles at the various zoom levels so I can act as a tile server for Google Maps via the API? Is there a program that will reliably generate the tiles for me and provide me with the necessary zoom and coordinates for each resulting tile and/or give me the correct tile if I provide the zoom and

2D tile map generation

杀马特。学长 韩版系。学妹 提交于 2019-12-02 16:23:28
I'm developing a 2D tile engine and at this moment I'm working on map generation algorithms. I tried the basic ones usually involved in simple heightmap generation like hill generation perlin noise diamond square but I always get the same problem: this kind of algorithms seems suitable when dealing with tile maps that also have a height component but this is not my case. I basically have sprites like grass, sea, desert and so on but they shouldn't be placed inside the map according to a generated height but something like everything starts from ocean islands are placed in the middle of the map

How do you load a tmx/xml file in javafx?

巧了我就是萌 提交于 2019-12-02 09:36:41
What is the most efficient way to add a tile map in a JavaFX program? The program that I use for creating tile maps is called "Tiled", and the saved files are in .tmx format. Now, the question is, how do I import that exactly in my 2d game? I haven't been able to find helpful information on the net. Code examples are greatly appreciated. Thanks Use the Eppleton JavaFX TileEngine (unfortunately this link is now dead: similar content is still hosted on javageeks : Beware link comes with annoying add popup ). Update : Unfortunately the eppleton blog entry previously linked, which contained

Bitmap with tile mode repeat and round corners

三世轮回 提交于 2019-12-02 07:54:20
问题 I have a bitmap with rounded corners method: Code: public static Bitmap getRoundedCornerBitmap(Bitmap bitmap, int pixels) { Bitmap output = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(), Config.ARGB_8888); BitmapDrawable TileMe = new BitmapDrawable(output); TileMe.setTileModeX(Shader.TileMode.REPEAT); TileMe.setTileModeY(Shader.TileMode.REPEAT); Canvas canvas = new Canvas(TileMe); final int color = 0xff424242; final Paint paint = new Paint(); final Rect rect = new Rect(0, 0,

“How To Make a Tile-Based Game with Cocos2D 2.X” Make this tutorial with cocos2d V3

断了今生、忘了曾经 提交于 2019-12-02 06:46:08
问题 I have a small problem. In this tutorial How To Make a Tile-Based Game with Cocos2D 2.X used cocos2d V2.0, I wanna make this in cocos2d V3.0. So, it doesn't work! Thanks! (I don't speak english) I think problem in this line - self.position = viewPoint; @property (strong) CCTiledMap *tileMap; @property (strong) CCTiledMapLayer *background; @property (strong) CCSprite *player; - (id)init { // Apple recommend assigning self with supers return value self = [super init]; if (!self) return(nil); //

Combine geom_tile() and facet_grid/facet_wrap and remove space between tiles (ggplot2)

妖精的绣舞 提交于 2019-12-02 03:51:13
问题 I have a data set with x, y, and z ( resp ) values along with two columns for facetting in order to create a grid of tile plots. The output of dput() is at the end of the post. library(ggplot2) My actual data set has six unique interactions between variables, however I've limited it to four for simplicity. I can create a tile plot with each unique combination, but not the whole set. The output of dput() is at the end of the post. I thought it might have to do with ggplot needing a common y

Actionscript 2 large tile-based maps creating lag

家住魔仙堡 提交于 2019-12-02 02:53:45
问题 I'm wondering what the best way to go about creating large, tile-based maps in flash with actionscript 2 would be. With my current code, any maps over 35x35 (1225 movieclips) start to lag. The maps are created from a simple multi-demensional array, eg. var map = [[95,23,25,23,16,25],[95,23,25,23,16,25],[95,23,25,23,16,25]]; The program simply creates a movieclip of a tile, goes to the appropriate frame and places the tile relative to the player's location. Each tile has one property, that is

How to change base layer using JS and leaflet layers control

纵然是瞬间 提交于 2019-12-02 02:26:27
I have to modify existing application, where leaflet layers control is used - I need to display one of the base layers when the map is initiated. Is there a way, how to call some function from the layers control from JS script - something like control.select(1) ....? If not, how can add a tile layer in the same way as it is done by the control - when I add new L.TileLayer during map init, it's not overwritten by manual layers control selection change? You could try to emulate a user click on the Leaflet Layers Control, but there is a much more simple way to achieve what you initially describe.