Get Place A Tile On Mouse Click And Allign It To A 50x50 Tile Grid?

Aug 22, 2010

im am making a vb 2010 tile egine and i was wondering how to get place a tile on mouse click and allign it to a 50x50 tile grid, and wonder how i can sav this to a .txt file from a array of thew tiles and question ask.

View 8 Replies


ADVERTISEMENT

Determine What Tile The Mouse Is On

Feb 28, 2011

I Making A Tile Map but i ran into a problem.How can i determine what tile the mouse is on?Here is some code of my project:

Private Sub GameMap_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles GameMap.MouseMove
mousex = e.X
mousey = e.Y

[code]....

View 3 Replies

Create A Tile Map That's Interactive With Mouse Clicks And Rollover Event?

Feb 1, 2010

Is there a way to create a tile map that allows a user to click a tile on the map and have an event happen? Better yet, can this be done in a web application?

View 5 Replies

Menu Tile On Click Color?

Aug 21, 2011

would like to know if anyone knows how to change, the back color of the menu tile when we click on them.

View 3 Replies

2D Tile Animation Layer On A Map?

Mar 28, 2010

(non-coding request)Okay, I have my client, my server, and my map editor...a 2d online game, and yes it's written in VB.NET.I have had a lot of trouble finding anything to do with adding an animation layer something that will flash with a timer to appear as if something like fire is animated. I have a lot done so far and I kinda want to stick with VB.NET working with this.

I'm not really looking for code here, but maybe an idea of "how" an animation layer plays into a map editor and client...specifically what is needed.Running this through my head I believe I am going to need a timer on both the map editor and client, showing and hiding the animation layer...but I don't think it is that easy, and am hoping someone here has an idea of the logic of how this works. I'm almost certain that the timer doesn't go on the server to control this, but am probably wrong.

View 2 Replies

Bitmap Manipulation In A Tile Game?

Apr 21, 2009

Essentially I have a half text/half graphical tile game that has a level designer. I have several sets of tiles, all of which are bunched together in one file. I'd like to read a certain 32x32 square of said bitmap, and display only that portion on specified area of the screen. I know GDI+ enough to get the display going, so I just need help with reading the specified portion of the image from the bitmap.

View 4 Replies

Get Closest Tile To Player On Screen?

Mar 17, 2012

I've managed to implement a formula that helps me to get the closest tile's distance that meets my requirements. The only thing is, I can't retrieve the actual tile for some reason... Tiles are named "Items" also. Here is my code:

[code]...

It puts green squiggly lines under ClosestItem and gives me the error: "Warning 2 Variable 'ClosestItem' is used before it has been assigned a value. A null reference exception could result at runtime."

View 7 Replies

Listviewitem And Columnheaders In Tile View?

Oct 26, 2009

Is it possible to show only the first 2 columnheaders in tile view of a listviewitem instead of all the definied columnheaders?

View 4 Replies

Made A Tile Map And Draw Character To It?

Feb 12, 2011

I Made a Tile Map And draw my character to it. All is well except gdi is slow. The map is 100,100. Can I draw my character over the map without redrawing the whole map each time? That Should make thing much smoother. Private Sub Face_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles PictureBox1.Paint

[Code]...

View 3 Replies

Tile Based Colision Detection?

Sep 14, 2009

I am slowly getting my little RPG going - My issue now is working out how to allow the player to walk over sometiles and not other. The tiles for now are painted to the form by the use of a Select Case i.e:

Case "1"
Draw Grass
Case "2"
Draw Wall

I would like to know how to set it up - the tile can be passable or not i.e:

[Code]...

View 5 Replies

Background Image In PictureBox With Tile Effect?

Jun 18, 2010

I have a picturebox and I have a image with a blue and red square. When I click a button it puts that image into the picturebox as background image. The background image property is set to tile. But when I click on my form to draw the image to it, it just draws the original not the one that has the tile effect from the picturebox. Is there a way i can do this to keep the tile effect?

View 5 Replies

Display Tile Of Web Page When Opened In Web Browser

Oct 17, 2010

I'm trying to display the tile of a web page when opened in the web browser on my for I'm using the code Me.text = browserwindow.documenttile..But this just displays the title from the previous file even though I run this after loading the new file

View 2 Replies

Forms :: Manually Do Tile Horizontal/Vertical

Apr 13, 2011

I have a program which contains a mdi form and child forms. Due to some reason the mdi form layout functionality does not work if a form is hidden and shown. This is a bug in the UI control suit which I am using.

I would like to implement Cascade,Tile horizontal & vertical myself. I wrote the logic for cascade but can I get code or function for the other two.

Would be glad if anyone can give me code/logic/function so that I can do Tile horizontal & Tile vertical manually.

View 4 Replies

Game Programming :: Collision Detection For Tile RPG

Feb 25, 2012

I'm trying ot make a top down rpg, or pokemon like game, but I can't find any proper tutorials for collision detection. I have found one, but when I did it it doesn't seem to work properly, and I get errors everytime I go to the edge of the form. What I can do to make good collision detection for walls?

HTML Code:
Public Class Form1
Public Level1 As New clsLevel()
Public Dude As New clsSprite(Level1)
Dim CanWalk As Boolean = True
[Code] ......

View 1 Replies

IENumerable And Tiles - Store The Information Of Each Tile?

Feb 1, 2010

While trying to find an answer to my question, I came across a project called OTSe, which allows people to make they're own online 2d online games. The system is based on an open X, Y, Z square tile map. For the sake of easy understanding, lets say they're are 3 types of tiles. Tiles you CANNOT walk on, tiles you CAN walk on, and tiles that SLOW YOU'RE CHARACTER DOWN.The project team has created a API class for users to work with in order to develop tools. What I'm trying to do, using they're classes, is GET the all the tiles on the current floor I am walking on, and then display them in a tile grid on my form, changing they're color depending on what type of tile they are. If the tile is NOT WALKABLE, make the tile gray, if the tile IS WALKABLE, make the tile brown, and if the tile SLOWS YOU DOWN, make the tile red. I also need it to store the information of each tile, since tiles are objects, and have properties.

[code]...

View 1 Replies

Interface And Graphics :: Best Way To Make A 'tile Selector' Box?

Jan 16, 2011

So now I will try to make something more complex, still playing around with this graphics thing.I want a picturebox to display a tileset (a bunch of 32x32 tiles normally used for creating game levels etc), the picturebox is inside a container (which has autoscroll ON). The picturebox is larger than the container, so the container will make scrollbars automatically.Now, I need to be able to choose a tile or multiple tiles (if I click & drag the mouse)Basically I want to draw a 32x32 "red" box over each selected tile (so the user knows what tiles are selected).So first of all, I need to know when the mouse clicks the picture. Good. It works.Now, I need to know which 32x32 tile was clicked. Well, I think I can calculate that just fine.BUT, what if the user drags the mouse while clicking on a tile? I want to support multiple tiles selected, but I am clueless about tracking what tiles were chosen.If we solve that problem, I would have another curiosity: You know the "red boxes" that tell you which tiles are selected? What would happen if I dragged the scroll bar? I need the redboxes to move along with the picture, and hide if they go to an invisible area.

View 6 Replies

Owner Drawing Listview In Tile Mode?

Oct 4, 2011

I am trying to owner drawing a list view in Tile View Mode. I am creating Items and add them in the ListView_DrawItem Event, but ListView_DrawSubItem is not firing.

I have been searching internet regarding this issue but I could not found anything relevant, the only thing I found was to call the DrawSubItem method.

View 14 Replies

Set As Desktop Background (Fill / Center And Tile)?

Jan 23, 2010

I'm using this code to set a picture as the desktop background:
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
SetDesktopWallpaper("C:\image.jpg")
End Sub
Private Shared Sub SetDesktopWallpaper(ByVal fileName As String)
[Code] .....
It works well, except the wallpaper is always centered. How can I have the ability to choose Fill, tile or center with separate buttons?

View 2 Replies

Switching List View From Tile To Details

Jun 12, 2011

Having an issue switching a listview from Tile to Details View with groups. When the list view has groups and the Default View is Tile, when changing the view to Details the first Group is not shown. Its under the column header. I jerry rigged it with creating a global variable to store the tile size and when switching to details view setting the tile size to a new size of 1,1. When switching back to Tile View setting the Tile Size to the Global Tile Size Stored.

[Code]...

View 4 Replies

Tile Game: Converting Pixels To X/y Coords

May 5, 2009

So now I'm working on the map editor for my game. The map itself displays 32x32 pixels out from the upper and left bounds of the form. Each tile is also 32x32. So then i have two labels which display the corresponding coordinates divided by 32, this way it would show you x: 7, Y: 8, or whatever. The issue is that the map will be like 15x10, and when moving the mouse to the 15th row/column, it shows 15, but then moving to the 14th row, still shows 15. The rest of it works fine. Here is the code.

Private Sub FrmDesign_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseMove
If e.X < (subZone.Width * 32) + 32 And e.X > ((subZone.Width * 32) -

[Code]....

View 3 Replies

Drawing From - User To Be Able To Select Any Tile, And Read Data From It?

Jan 30, 2010

Say I have a tile map, example:

111111
122221
122221
111111

And we know that the total X and Y coordinates of the map is (6, 4), with the numbers 1 and 2 representing different tiles at specific coordinates.I have already retrieved the X and Y coordinate for each tile, now all I want to do is duplicate(clone) the entire map. After I clone it, I want the user to be able to select any tile, and read data from it.

View 11 Replies

Game Programming :: Mario Like Jump In Tile Engine

Jan 24, 2012

I have a very basic tiling engine that was made from a YouTube tutorial for making an top down RPG style game and I am trying to adapt it to a platformer game. The code is fairly simple but not being a physics guy I am looking for adding a Mario style jump to the program. I know there will most likely need to be some additional variables added to it such as gravity and velocity. That said I am not sure where to get started, below is the meet and potatoes so to speak of the program.

Code:
' VIEW PORT
Dim ResWidth As Integer = 750
Dim ResHeight As Integer = 550
Dim TileSize As Integer = 32
' GRAPHICS VARIABLES
[Code] ......

View 1 Replies

VS 2008 Resize And Tile Image As Form Background?

Aug 14, 2009

I'm making a tileset creator and everything is working fine so far except previewing a tile. The way it works now is it gets the image from a picturebox and calls the following code when scrolling the mousewheel. It functions fine but there is a border appearing between the tiles and I can't figure out why. The source image is 32x32 in size. Most likely it is the graphics class not measuring in pixels or something.

Public Sub ResizePreview(ByVal dSize As Drawing.Size)
Dim bm As New Bitmap(TileImage.Image)
Dim pTile As New Bitmap(dSize.Width, dSize.Height,

[Code].....

View 2 Replies

Handle The Back Key From ConnectionSettingstask Called Directly From A Secondary Tile

Mar 8, 2012

i have a small wp7 application with just a main page. The main page has 4 buttons and calls the ConnectionSettingstask for wifi, bluetooth, airplanemode and cellular data setting. I have also managed to create secondary tiles for any of these buttons. The OnNavigateTo event handles the secondary tiles using a key passed from the tile [code]The problem ia that when the user uses the secondary tile to call a task, the application opens directly the connection settings page, but after that the back key, instead of opening the phone main menu, open the main page of my application

View 1 Replies

Game Programming - Detect The Collision Of NPC's That Load Onto 2d Tile Map From Text File

Jun 25, 2009

I have a question about collision, yes my 2d tile rpg's map collision works just fine, but im having trouble with the collision with my npc's. At the start of the game it loads all the map data from a text file. well it also loads the location and other stuff about the npc's onto the map from a text file. how do i detect the collision of the npc's that were loaded from the text file, i could do collision with hardcoded npc's but i want to avoid hardcoding the game content into the game engine. RESTATING MY QUESTION: How do i detect the collision of NPC's that i load onto my 2d tile map from text file?

View 6 Replies

Interface And Graphics :: Lots Of Data To Handle - Locate A Tile In The Map When It Is Clicked?

Jan 31, 2011

My tile-based map editor project. So far, it works really awesome. Here, look at a picture: [URL] And the screenshot is outdated: Now I got the Pencil, Rectangle and FloodFill tools too!, the tilesets are from that popular (well, not so popular) game engine called RPGMaker.

Currently, this is how the map is structured:
One ArrayList represents the X coordinates.
One ArrayList in each X represents the Y coordinates.
One ArrayList in each X,Y represents the tile.
The tile is an ArrayList containing three elements:
The Image name (Tileset01 in the screenshot), the X coordinate in the image, and the Y coordinate in the image. Those coordinates are from the TILESET01 image, not map.

Getting the idea?
How do you locate a tile in the map when it is clicked?
First I get the cursor's position on the map picturebox, then convert it to a multiple of 32 (the tiles are 32x32, yes), divide the position X and Y by 32. The results are the indexes I need to get to the tile I clicked.

That method works just fine for me.

When the map picturebox invalidates and needs painting... When that happens, I iterate through each X and Y arrayList. When I get the arrayList that represents the tile, I use it to draw on the map.

For example:
Iterating X arrayList.... step 8......
Iterating Y arrayList..... step 3.......
Found arrayList with three elemetns: ("Tileset01",32,96)
Draw image on the map picturebox, source is "Tileset01" on rectangle (32,96,32,32)... draw it on map picturebox's point (8 * 32) and (3 * 32)

And so on.

Now you understand how I am working with my map editor, how I am locating clicked tiles, and how I am drawing it. Everything goes fine, except for one problem: At some point, the user might want to make a 500x500 map.

That means, an arrayList with 500 elements representing the X tiles. Then an arrayList with 500 elements for each X tile, representing the Y tiles. Then an arrayList in each X,Y pair.

Then multiply that result by 5, because there will be 5 drawing layers. How am I supposed to handle such huge maps?! My app explodes when I set the map dimensions to 500x500! 500x500 is the max setting allowed in my app. I also know that 500x500 map editors are possible, because I have seen others before. With great performance.

View 1 Replies

Place Multiple Units On The Battlefield With Mouse Click

Oct 16, 2010

I'm trying to place multiple units that have already been selected on a previous form to appear where selected on the battlefield. I have tried it multiple ways and all I can do is get one to appear not the econd ect.

[Code]...

View 1 Replies

Place / Drop An Image Every Time Click The Mouse Button?

Feb 9, 2012

I looked at "How do I place an image with a mouse-click in Javascript?" but it had a small snippet of Java; immensely larger than my knowledge of Java. And that is the closest I've come to finding an answer in the past week. Here's what I would like to do (don't know if its even possible):

I have a panel and a toolstrip with 3 buttons. Each button represents a different image. I want to click on a button (once) and then move into the panel and everytime I click the mouse button it drops the image where ever I clicked. This only ends when either I click back on the same button or one of the other buttons. I do not want to drag an image into the panel each time. In other words the button stays depressed and the event/action stays active.

View 2 Replies

Show Data In Textbox When Mouse Click On Any Cell Grid In .net With Text File?

Jun 30, 2010

how to show data in textbox when mouse click on any cell grid in vb.net with text file?

View 6 Replies

Mouse.Click And Mouse.MouseDown - Delay The Mouse Down Event

Apr 15, 2012

I have two custom action listers. One that handles Mouse.Click and one that handles Mouse.MouseDown. My question to you is, can I delay the mouse down event so that it does not intefere with the code of the Mouse.Click event? I have tried adding a timer and waiting x amount then setting a bool value to true, but the code executes to fast and it skips the other code.

View 6 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved