PDA

View Full Version : Translating by clicking (Hand mode)



Resiliant
04-16-2003, 05:56 PM
Yippee!

I get to make the first dev post!!@!

OK..

I'm actually learning C#.. so this may take a while, but I'm currently workin on the 'hand' shifter. Got the right place I think, and got the right events coded... just trying to figure out error messages n'such.. its a learning experience

R

cavemanbob
04-16-2003, 06:17 PM
That's a good idea, it should be easily doable with the mousemove event modifying the offsetx and offsety.

Resiliant
04-16-2003, 10:03 PM
Yea... Use the MouseDown and MousUp to change the cursor type, and then MouseMove.. relative to the MouseDown location to determine the new origin.

If i was doing it in VB or in C it would be already working :P Too bad im doing it in C#. I coded the mouse up/down events.. but it was telling me that something or the other wasn't defined correctly...

Anyway.. More later

R

cavemanbob
04-16-2003, 10:05 PM
It could be even simpler than that, MouseMove gets the Button states as well as the movements.

Dark
04-17-2003, 12:01 AM
Could we get a button to centre the map in your char please?:D

Resiliant
04-17-2003, 02:02 AM
Actually not CB...

You need to record the mouse down event so you have the starting point for the drag, and set a relocation semaphore. Otherwise you have to do some kinda kinky polling of the mouse state. The amount for the map origin translation is the x and y delta from the initial mouse down point. You have a pair of local variables that record the mouse down point, and then continually recompute a new origin transformation for each mouse move event when the semaphore is true. When the Mouse Up event occurs, you then simply reset the semaphore to false :)

R

Resiliant
04-17-2003, 02:14 PM
CMB,

I've completed the clickie-Hand transformation feature. (Well.. it does a couple bizzare things that I think are related to your code.. but it mostly works great :) )

What's the best way to get it to you? I have a little cursor file, and an annotated version of MapCon.cs :)

R

cavemanbob
04-17-2003, 02:18 PM
Zip it and attach it to a reply if you can.

Resiliant
04-17-2003, 02:37 PM
Ok.. here goes :)

The zip file is attached. I prefixed any changes to the code with a '\\~~' comment line to make it obvious where changes were made.

The code basically works, except occasionally when you're dragging the map, it tends to warp out .. i *think* its the automatic recentering you do.. but im not sure. Anyway.. here it is :)

R

cavemanbob
04-17-2003, 02:44 PM
OK, I'll add it in.

Resiliant
04-17-2003, 03:09 PM
OK... let's see.. what's next...

How about... a slight modification to the spawn sprite for player characters? You know... it's been so long since I used SEQ I have completely forgot how SEQ draws players... :P How should we draw player sprites differently from NPC sprites?

R

P.S. Have you recorded anywhere the meanins of the SPAWNINFO 'type' field?

high_jeeves
04-17-2003, 05:23 PM
type is simple:

0 = PLAYER
1 = NPC
2 = CORPSE

3 used to be NPC_CORPSE, but it seems that all PC and NPC corpses are now 2.

--Jeeves

cavemanbob
04-17-2003, 05:28 PM
The code to tell the difference between those has been in there for a while. What shape would you like for players or npcs, it's like a 1 line change.

datadog
04-17-2003, 08:03 PM
Been a while, but I think in SEQ, the players dots were surrounded by a pink square (or perhaps overlayed onto a pink square).

Corpses were hollow yellow squares (most likely just like the pink ones).

Something along those lines works for me =)

cavemanbob
04-17-2003, 08:43 PM
K, it's been ages since I last ran showeq so I couldn't remember the icons either.