Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add example on how to use the mouse #120

Open
2 tasks
tehKaiN opened this issue Jun 9, 2020 · 2 comments
Open
2 tasks

Add example on how to use the mouse #120

tehKaiN opened this issue Jun 9, 2020 · 2 comments

Comments

@tehKaiN
Copy link
Member

tehKaiN commented Jun 9, 2020

Is there any example of how to use a mouse?

I'm looking at Open Fire's code. I've copied cursor.c, cursor.h and cursor.bm to my project and then I included the cursorCreate, cursorUpdate and cursorDestroy calls but nothing happens.

Maybe I missed something related to the Copper. Anyway it would be good to have an example of a mouse application in the showcase.

Originally posted by @deuteros76 in #24 (comment)

Todo:

  • Code in showcase
  • Tutorial in ACE's docs
@tehKaiN
Copy link
Member Author

tehKaiN commented Jun 9, 2020

will do sooner than later

@tehKaiN
Copy link
Member Author

tehKaiN commented Jun 9, 2020

I'm now looking at code from openFire and it should work, perhaps there's some kind of regression.

The absolute bare minimum to process a mouse should be:

  • do a mouseCreate() / mouseDestroy() somewhere - on game create/destroy or gamestate create destroy or something
  • between them do mouseSetBounds() at least once
  • do a mouseProcess() periodically
  • after above steps mouseGetX() and mouseGetY() should return current x/y position of a mouse
  • then one can go crazy with rendering mouse cursor - it could be blitter based (blitRect, blitCopy, line drawing fns) or sprite based (there are no examples for using sprites!)

Now to do an example for that.

@tehKaiN tehKaiN added this to the TBD before C++ experiments milestone Oct 29, 2023
@tehKaiN tehKaiN mentioned this issue Oct 29, 2023
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant