Results 1 to 15 of 15

Thread: Translating by clicking (Hand mode)

  1. #1
    Registered User
    Join Date
    Oct 2002
    Posts
    115

    Translating by clicking (Hand mode)

    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

  2. #2
    Moderator
    Join Date
    Jan 2003
    Posts
    426
    That's a good idea, it should be easily doable with the mousemove event modifying the offsetx and offsety.

  3. #3
    Registered User
    Join Date
    Oct 2002
    Posts
    115
    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

  4. #4
    Moderator
    Join Date
    Jan 2003
    Posts
    426
    It could be even simpler than that, MouseMove gets the Button states as well as the movements.

  5. #5
    Registered User
    Join Date
    Jan 2003
    Posts
    87
    Could we get a button to centre the map in your char please?
    I believe in gun control. I use both hands

  6. #6
    Registered User
    Join Date
    Oct 2002
    Posts
    115
    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

  7. #7
    Registered User
    Join Date
    Oct 2002
    Posts
    115
    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

  8. #8
    Moderator
    Join Date
    Jan 2003
    Posts
    426
    Zip it and attach it to a reply if you can.

  9. #9
    Registered User
    Join Date
    Oct 2002
    Posts
    115
    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
    Attached Files Attached Files

  10. #10
    Moderator
    Join Date
    Jan 2003
    Posts
    426
    OK, I'll add it in.

  11. #11
    Registered User
    Join Date
    Oct 2002
    Posts
    115
    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?
    Last edited by Resiliant; 04-17-2003 at 03:14 PM.

  12. #12
    Registered User
    Join Date
    Dec 2001
    Posts
    1,262
    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
    "Only two things are infinite, the universe and human stupidity, and I'm not sure about the former." --Albert Einstein

  13. #13
    Moderator
    Join Date
    Jan 2003
    Posts
    426
    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.

  14. #14
    Registered User datadog's Avatar
    Join Date
    Mar 2002
    Posts
    152
    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 =)

  15. #15
    Moderator
    Join Date
    Jan 2003
    Posts
    426
    K, it's been ages since I last ran showeq so I couldn't remember the icons either.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

You may post new threads
You may post replies
You may post attachments
You may edit your posts
HTML code is Off
vB code is On
Smilies are On
[IMG] code is On