Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Creating a Mapping Tool for a RPG Game

Posted on 2002-07-02
8
Medium Priority
?
299 Views
Last Modified: 2010-05-02
I have written the RPG Game but want the user to be able to map his journey on the way.
I have a toolbar which contains various images i.e. Small Room, Monster, Sword etc. and I want the user to be able to double click one or drag/drop and then be able to position it on a picture box or an appropriate container.

I haven't got a clue about how to approach this so any ideas, however small will be appreciated.

Andy.
0
Comment
Question by:HelpAndy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
8 Comments
 
LVL 8

Expert Comment

by:glass_cookie
ID: 7125631
Hi!

Regarding the double clicking, you could use this code to determine the position on the map that's clicked:

Private Sub Picture1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
MsgBox X, Y
End Sub

or, if you do not mind your program processing a little more, do this:

Dim X1 As Integer, Y1 As Integer

Private Sub Picture1_DblClick()
MsgBox X1 & ", " & Y1
End Sub

Private Sub Picture1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
X1 = X
Y1 = Y
End Sub


As for the saving of the map part of your program, you could do something like save all the positions in some format like this:

Sword 345,675
Monster 346,678
Monster 2865,293

while you loop through the saved file, you could then load the pictures in the form of an array : )

That's it!

glass cookie : )
0
 

Expert Comment

by:carlosferreira
ID: 7125697
Hi -

I don't really have an answer mainly because I'm not sure if you are envisioning as an interface.  I came across and interesting vb project which does critical path analysis.  In essence what it does is creates a graph on the form which icons placed where you specify it to be (right click on form - select node).  The graph can be saved and retrieved in xml format.  I thought it was a brillant way of allowing someone to visually draw something on a blank form.  It would probably be worthwhile to go thru the project to see how it is implemented.  It was originally presented in a project for VBPJ and the link of the article can be found here:

http://www.devx.com/upload/free/features/vbpj/2000/11nov00/ja0011/ja0011.asp

The actual code can acutally be downloaded here:

http://www.joyofvb.com/Downloads/Implementation%20Workshop/CPA.zip

I haven't actually read the article but the code is a good study.

I hope this helps.

Carlos
0
 

Author Comment

by:HelpAndy
ID: 7126336
Thanks for the input guys!

I had a thought last night that when you paste an image in MS Paint you can then position it within the overall picture.
I wonder if this is done via obtaining the windows handle of what you have pasted allowing you to move it around before deciding on the exact position.
Is this done via the API ?
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 8

Accepted Solution

by:
glass_cookie earned 400 total points
ID: 7128936
Hi!

I'm not very sure how it's done, but another alternative is to move a picture box around the form by draging it.

I saw it in a book that I borrowed from the library some years ago but I forgot about it :|

Let me look for it...


OK found it:

Download...
http://www.vb-helper.com/HowTo/dragpic4.zip
Description: Drag a PictureBox (2K)

That's it!

glass cookie : )
0
 

Author Comment

by:HelpAndy
ID: 7129300
Glass Cookie, you are a Diamond!
0
 
LVL 8

Expert Comment

by:glass_cookie
ID: 7129591
Thanks for the points, and your last comment : )

Thank you : )
0
 

Author Comment

by:HelpAndy
ID: 7129717
I see you live in Singapore.
I almost made it there but got ill.
I worked in Hong Kong for a while and love your part of the world.
0
 
LVL 8

Expert Comment

by:glass_cookie
ID: 7130858
Hi!

I've been to Hong Kong too quite a few times : )  You've got great food in Hong Kong ; )

Hope you'll like it the next time you come to Singapore : )

That's it!

glass cookie : )
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question