tile

Getting started with a Tile-based game in Qt using QGraphicsScene and QGraphicsView

雨燕双飞 提交于 2019-12-03 13:11:54
I'm going to start programming a 2D tile-based game in Qt and read about the QGraphicsScene and QGraphicsView classes which are intended for displaying and handling lots of 2D objects. My question is that will it be feasible to create a world with lots of tiles using QGraphicsScene? Can I add the whole world at once tile-by-tile or should I try to implement something to restrict the area a bit? I've read that QGraphicsScene can handle "thousands of items" but a 2D tile map can easily get really, really big (200x200 tiles? not that many, but that's already 40,000 objects which is a lot). The

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

人走茶凉 提交于 2019-12-03 10:20:52
问题 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

Keep tiles visible while loading TileOverlay Map API v2 Android

烈酒焚心 提交于 2019-12-03 10:06:26
I would like my TileOverlay to behave like the real Google Maps. When you zoom in, the tile is still visible but pixelized until the new tile is downloaded. The current behavior is: when you zoom in, tiles disappear and you see the ugly grid, and the user has to wait until the new tiles are loaded. This is kind of annoying. Is there a solution to this problem? I worked around this issue by "preloading" all zoomlevels before showing the map (just a copy/paste of the current state, need to clean up): @UiThread private void preloadAllZoomLevels(final float zoomLevel) { if (zoomLevel == map

Offline tile caching using MapBox Android SDK

对着背影说爱祢 提交于 2019-12-03 08:39:00
I have a working iOS prototype using the iOS tile-caching technique as shown below (Objective-C code): RMTileCache * tileCache = [[RMTileCache alloc] initWithExpiryPeriod:0]; [tileCache setBackgroundCacheDelegate:self]; RMMapboxSource * tileSource = [[RMMapboxSource alloc] initWithMapID:mapID]; [tileCache beginBackgroundCacheForTileSource:tileSource southWest:southWest northEast:northEasth minZoom:minZoom maxZoom:maxZoom]; What this basically does is download the map, cache the tiles permanently and make it possible for the app to run offline in the future. Since we're going through the

Tileset for HTML5 canvas game

匆匆过客 提交于 2019-12-03 08:18:18
I'm trying to make a game in HTML5 canvas, but instead of uploading a ton of images I want to just upload one image that has all of the tiles on it. The problem is, I don't know how to make only one part of the image show up. Basically I want to do what Google does with this image: http://www.google.com/images/srpr/nav_logo27.png except with fixed height/width tiles. Can someone explain to me how to do this? Also, if it's different in canvas than in a regular html page without canvas, how would I do it in canvas? gblazex You can use the slicing parameters of drawImage drawImage(image, sx, sy,

render a tile map using javascript

人走茶凉 提交于 2019-12-03 04:30:43
问题 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

Reading JSON Tiled map editor file and displaying to canvas

白昼怎懂夜的黑 提交于 2019-12-03 03:45:00
Im following this this tutorial to be able to load json map files created by tiled map editor in my javascript/canvas game. ive got to the point where i have implemented my own kind of version, and am getting no errors in firebug in console or net etc. And as far as i can see, by putting in console.logs and alerts, the script is running absolutely fine! The problem is the canvas stays blank! when it should have a tilemap now on it. Here is my version of the tutorial implemented in my game: function Level() { var c; var data; var layers = []; this.get_map = function(name,ctx){ c = ctx; $

Google Maps API V3 - Custom Tiles

家住魔仙堡 提交于 2019-12-03 03:24:04
I am currently working on Google Maps API V3 over here If you zoom between 21 to 23, there will be an image overlay on the map. The image takes too long to load and I have decided to break it into different tiles for easier loading. I am using Automatic Tile Cutter to cut the image into tiles. I have problems with the script; var OrgX = 31551; // the Google Maps X value of the tile at the top left corner of your Photoshop document var OrgY = 50899; // the Google Maps Y value of the tile at the top left corner of your Photoshop document First question How do you find the values of X and Y from

Convert a single large image overlay to tiles for Google Maps

走远了吗. 提交于 2019-12-03 03:20:09
问题 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

2D tile map generation

别等时光非礼了梦想. 提交于 2019-12-03 01:04:52
问题 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