tile

How to change base layer using JS and leaflet layers control

可紊 提交于 2019-12-02 02:22:31
问题 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? 回答1: You could try to emulate a user

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

自古美人都是妖i 提交于 2019-12-02 01:51:43
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); // Enable touch handling on scene node self.userInteractionEnabled = YES; self.tileMap = [CCTiledMap

Actionscript 2 large tile-based maps creating lag

江枫思渺然 提交于 2019-12-01 23:44:54
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 'walkable' which is either true or false which determines if the player can walk on it or not. These

Javafx - Determine position of cursor on right click relative to gridpane

人盡茶涼 提交于 2019-12-01 13:04:45
问题 I have a 40x40 gridpane, displaying a map. Currently, i have the following methods listening for a right click: //detect right click + display menu, select if you want to place item 1 or item 2 final ContextMenu cm = new ContextMenu(); cm.addEventFilter(MouseEvent.MOUSE_RELEASED, new EventHandler<MouseEvent>() { @Override public void handle(MouseEvent event) { if (event.getButton() == MouseButton.SECONDARY) event.consume(); } }); cm.setOnAction(new EventHandler<ActionEvent>() { @Override

libGdx How to use images or actor as body

寵の児 提交于 2019-12-01 10:37:31
I gone through the libGdx wiki/tutorial but I didn't find example to use an image or an actor as a physics body. In my game I am adding an actor to the stage. But I want to add this actor or sprite image as physics body. I have to drag this actor and even want to detect collision with other bodies. please give me reference if you have. Thanks This is a bit tricky. You don't use an image or an Actor as a physics body. You will need to implement something like a new "PhysicsActor" which extends Actor. This Physics actor will have a body as a property and will be the bridge between your libgdx

Pin program to start menu using PS in Windows 10

陌路散爱 提交于 2019-12-01 09:02:46
问题 I am trying to pin a program to the start menu in Windows 10 $shell = New-Object -ComObject "Shell.Application" $Folder = $shell.NameSpace("C:\Test") $exe = $Folder.ParseName("notepad.exe") #$exe.Verbs() $ItemVerbs = $exe.Verbs() Foreach($ItemVerb in $ItemVerbs) { If($ItemVerb.Name.Replace("&","") -match "Pin to Start") { $ItemVerb.DoIt() Write-Host "Pin to the Start menu sucessfully.+ ""$ItermVerbTxt"" " -ForegroundColor Green } } After executing this code, i see the success message which

libGdx How to use images or actor as body

你说的曾经没有我的故事 提交于 2019-12-01 08:07:45
问题 I gone through the libGdx wiki/tutorial but I didn't find example to use an image or an actor as a physics body. In my game I am adding an actor to the stage. But I want to add this actor or sprite image as physics body. I have to drag this actor and even want to detect collision with other bodies. please give me reference if you have. Thanks 回答1: This is a bit tricky. You don't use an image or an Actor as a physics body. You will need to implement something like a new "PhysicsActor" which

How to get your image URL tiles? (google maps)

半腔热情 提交于 2019-11-30 18:18:16
问题 I'm looking on how to generate your own image tiles and put to the server as this example do. The example load tiles from http://mt3.google.com/mapstt?..., but how if I want my image? var trafficOptions = { getTileUrl: function(coord, zoom) { return "http://mt3.google.com/mapstt?" + "zoom=" + zoom + "&x=" + coord.x + "&y=" + coord.y + "&client=google"; }, tileSize: new google.maps.Size(256, 256), isPng: true }; var trafficMapType = new google.maps.ImageMapType(trafficOptions); var map;

Efficient 2D Tile based lighting system

不羁的心 提交于 2019-11-30 11:57:22
问题 What is the most efficient way to do lighting for a tile based engine in Java? Would it be putting a black background behind the tiles and changing the tiles' alpha? Or putting a black foreground and changing alpha of that? Or anything else? This is an example of the kind of lighting I want: 回答1: There are many ways to achieve this. Take some time before making your final decision. I will briefly sum up some techiques you could choose to use and provide some code in the end. Hard Lighting If

How to repeat an image in C#

允我心安 提交于 2019-11-30 11:44:32
I have an image with a certain pattern. How do I repeat it in another image using GDI? Is there any method to do it in GDI? In C#, you can create a TextureBrush that'll tile your image wherever you use it, and then fill an area with it. Something like this (an example that fills the whole image)... // Use `using` blocks for GDI objects you create, so they'll be released // quickly when you're done with them. using (TextureBrush brush = new TextureBrush(yourImage, WrapMode.Tile)) using (Graphics g = Graphics.FromImage(destImage)) { // Do your painting in here g.FillRectangle(brush, 0, 0,