Results 1 to 8 of 8

Thread: hum little probleme about cursor

  1. #1

    Thread Starter
    Junior Member TheKGBspy's Avatar
    Join Date
    Nov 2001
    Posts
    21

    Talking hum little probleme about cursor

    yo all im new in this forum but not new to vb . im making a game with one of my friend called Zasz on this forum. The gam ereally look good . its a real time strategie Commandos style. for now you can control 6 elite soldier: make them crawl, fire,...
    anyway there my problem:

    i try to put animated cursor (.ani) to my game and that dont seem to work. vb 5 dont want to read them. (i have vb 6 at home and vb5 at school and my program is my school project. im so advanced in informatic, the teacher make me make what i want so im making a game).

    and also im trying to put red cursor (.cur) in my prog but they appear in black!!

    can sombody help me plz ?

  2. #2
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    You can control the animation yourself. Look around here (search vb-world above @ the VB Forums) for an example of Bitblt and GetCursorPos. What you can do is use Bitblt to Blit a transparent (non-square) cursor where the mouse is. You would also have to hide the original mouse cursor with the showcursor API call. I don't think VB supports .ANI cursors on it's own, but you could store them in a series of frames and work with them that way. I think there may be another way, too...

    I'll see what I can do for you in the meantime.
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  3. #3
    Zaei
    Guest
    As Sas said, .ani cursors are not supported in VB. You can create a set of regular .cur cursors, and loop through them to simulate the animation, or use BitBlt as Sas mentioned.

    Z.

  4. #4
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    Plus it would be easier to solve if your application was fullscreen or better yet DirectX.
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  5. #5
    PowerPoster rjlohan's Avatar
    Join Date
    Sep 2001
    Location
    Sydney, Australia
    Posts
    3,205

    Re: hum little probleme about cursor

    Originally posted by TheKGBspy
    yo all im new in this forum but not new to vb . im making a game with one of my friend called Zasz on this forum. The gam ereally look good . its a real time strategie Commandos style. for now you can control 6 elite soldier: make them crawl, fire,...
    anyway there my problem:

    i try to put animated cursor (.ani) to my game and that dont seem to work. vb 5 dont want to read them. (i have vb 6 at home and vb5 at school and my program is my school project. im so advanced in informatic, the teacher make me make what i want so im making a game).

    and also im trying to put red cursor (.cur) in my prog but they appear in black!!

    can sombody help me plz ?
    Guess I should read posts b4 I post my own... I just posted the 'Why is it black??!!??' question...

    So, why do cursors come in B&W only, no colours??
    -----------------------------------------
    -RJ
    [email protected]
    -----------------------------------------

  6. #6

    Thread Starter
    Junior Member TheKGBspy's Avatar
    Join Date
    Nov 2001
    Posts
    21
    ok tanx. for the picture i already tought about it but it will be very tricky for my program. i use many picture box so if i put a image on my form and i want to go in the picture box th epicture will be under the picture box! anyway ill post some picture of my program tommorow.

  7. #7
    Junior Member
    Join Date
    Nov 2001
    Location
    Victo, Québec, Canada
    Posts
    30
    Originally posted by Sastraxi
    You can control the animation yourself. Look around here (search vb-world above @ the VB Forums) for an example of Bitblt and GetCursorPos. What you can do is use Bitblt to Blit a transparent (non-square) cursor where the mouse is. You would also have to hide the original mouse cursor with the showcursor API call. I don't think VB supports .ANI cursors on it's own, but you could store them in a series of frames and work with them that way. I think there may be another way, too...

    I'll see what I can do for you in the meantime.
    "Series of frames"

    Can someone explain a code to put picture in a single file?
    bcuz we have a lot of .jpg and would like to put them in the same file. thanks

    ZaSz

  8. #8
    Zaei
    Guest
    if all of the images are the same size, you can assign each picture an ID number (in your program), and get the picture using that:
    Code:
    Cosnt Size as Long = 256
    Const NumAcross as Long = 4
    
    Private Sub GetPic(ID As Long)
       Dim PX as Long
       Dim PY as Long
       PX = ID mod NumAcross * Size
       PY = ID \ NumAcross *Size
    
       '....
    End Sub
    Should work fine. If the images are different sizes, you can create a file that has the ID, then an X, Y, SizeX, and SizeY, to get the info about the image.

    Z.

    [edit]
    Opps, used the C++ mod operator instead of the VB one. Fixed.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width