Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Squeak  (Read 11516 times)

0 Members and 1 Guest are viewing this topic.

Hapax

  • Hero Member
  • *****
  • Posts: 3351
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Squeak
« on: February 18, 2014, 03:10:52 am »
Current version: 1.0.3 (download for Windows)

Updates
1.0.3:
. Added ability to refresh the positions of the contextual display and tool-tip after altering the text within them.
. Added ability to remove the cursor and just use the toop-tip and contextual display, which allows you to use them with the hardware cursor.

About
Squeak is a simple and small add-on that easily allows you to change the mouse cursor while it's inside your window.

I created this while working on something else and decided that it would be useful to have it always accessible for future projects. I then realised that other people could benefit from a tiny bit of saved time too. It also gave me the opportunity to learn how to build a DLL, which is not something that is fun.

Squeak also has a built-in tool-tip and contextual display, both of which are automatically resized based on their text content. They are customisable too: colours, padding, outline, tool-tip timers etc.. They can both be activated and deactivated individually. They also both reposition to stay within the window's border. The contextual display can be displayed above or below the cursor whereas the tool-tip is always display on top (layer-wise, not position - positions can be adjusted).

It can be run and used with minimal code. Only two lines are required inside the main loop: update and draw. It automatically updates itself from window events.

You can decide to allow the cursor image to scale with the display as it stretches or restrain it to keep a persistent size. You can also use Squeak to "get" the current mouse position; it can return either coords or pixels.

Here is a video of it in action:


Unfortunately, you can't really see the green, custom mouse cursor as the video capturing software that I used ignores the "remove mouse cursor" command and places it right back on top :( So, here's a screen shot:


Download
Anyway, I hope some people find some use of it. The download is a .zip file that contains the .h file, the .lib file, the .dll file, a readme, and a couple of simple examples (the examples were used for the screenshot and video).
You can download it from MediaFire. It's provided under the zlib licence.

Feedback
If you you have any suggestions or find any bugs, feel free to leave them in a comment on this thread.
« Last Edit: June 29, 2014, 02:34:16 pm by Golden Eagle »
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

Cadisol87

  • Full Member
  • ***
  • Posts: 129
  • C++ Programmer
    • View Profile
Re: Squeak
« Reply #1 on: March 01, 2014, 03:40:25 pm »
Hmm looks pretty nice, I maybe will use it in future projects :)

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6286
  • Thor Developer
    • View Profile
    • Bromeon
Re: Squeak
« Reply #2 on: March 01, 2014, 04:49:58 pm »
You could add it to the Wiki, so that it will not be lost in the depths of the forum ;)
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

Hapax

  • Hero Member
  • *****
  • Posts: 3351
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: Squeak
« Reply #3 on: March 02, 2014, 12:09:03 pm »
Thanks, Nexus. Will do :)
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

Ixrec

  • Hero Member
  • *****
  • Posts: 1241
    • View Profile
    • Email
Re: Squeak
« Reply #4 on: March 02, 2014, 04:59:49 pm »
I think I might use this too.

I notice there's no mention of a license in the readme.  Could you add one to the .zip or your OP post?  Just saying it's the same as SFML would be fine (or anything else that allows static linking).

Hapax

  • Hero Member
  • *****
  • Posts: 3351
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: Squeak
« Reply #5 on: March 02, 2014, 06:46:45 pm »
I think I might use this too.
Awesome. I hope it helps :)

I notice there's no mention of a license in the readme.  Could you add one to the .zip...
A licence has been to the zip. It's under zlib, so enjoy!
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

migizi

  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: Squeak
« Reply #6 on: May 07, 2014, 10:53:15 pm »
Is there any noticeable delay with this? I see in the video when you make some rapid movements the cursor software cursor lags a little? When it lags do the clicks and position reflect the current position of the software or hardware mouse?

Otherwise it looks very nice.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10821
    • View Profile
    • development blog
    • Email
AW: Squeak
« Reply #7 on: May 08, 2014, 12:13:56 am »
The system cursor seems indeed to be "faster", but programming wise this just an illusion. The system cursor gets updated at a different rate, thus when the image is draw the system cursor already moved again a bit and as such seems faster.

What you need to keep in mind is: In order to draw the custom mouse cursor, the position of the mouse is used. So of course the mouse position matches the custom cursor position, brcause they are the same thing! ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Hapax

  • Hero Member
  • *****
  • Posts: 3351
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: Squeak
« Reply #8 on: June 29, 2014, 12:17:51 am »
Updated to version 1.0.3.
A couple of minor updates that I felt were necessary: ability to refresh positions after updating texts, and ability to remove cursor but use the add-ons, which would allow you to use the hardware cursor with the tool-tip and contextual display, if required.
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

Peteck

  • Jr. Member
  • **
  • Posts: 55
    • View Profile
Re: Squeak
« Reply #9 on: June 29, 2014, 01:39:25 pm »
You should really make it possible for people to use this as a static library. I would never use this if I had to transport a .dll file with my project just for these cursor helpers.

Hapax

  • Hero Member
  • *****
  • Posts: 3351
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: Squeak
« Reply #10 on: June 29, 2014, 02:11:17 pm »
You should really make it possible for people to use this as a static library. I would never use this if I had to transport a .dll file with my project just for these cursor helpers.
I wasn't aware that there was much interest in it, let alone interest in using it for more than just personal convenience. Unfortunately, I have no idea how to make a static library but I'll certainly be looking into it. This is all about learning, after all :)
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

Ixrec

  • Hero Member
  • *****
  • Posts: 1241
    • View Profile
    • Email
Re: Squeak
« Reply #11 on: June 29, 2014, 02:16:04 pm »
Incidentally, any chance of this getting a Mac/Linux implementation? Or source code?

Peteck

  • Jr. Member
  • **
  • Posts: 55
    • View Profile
Re: Squeak
« Reply #12 on: June 29, 2014, 05:15:23 pm »
I wasn't aware that there was much interest in it, let alone interest in using it for more than just personal convenience. Unfortunately, I have no idea how to make a static library but I'll certainly be looking into it. This is all about learning, after all :)
Well static libraries is a lot easier to make. So don't worry if you think it will be hard to learn :)

Hapax

  • Hero Member
  • *****
  • Posts: 3351
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: Squeak
« Reply #13 on: July 07, 2014, 01:38:40 am »
Incidentally, any chance of this getting a Mac/Linux implementation? Or source code?
I wasn't really planning on doing that much with this. I created it for my own convenience and education; I use in it DLL form. I just thought it could help some others. I don't have a Mac or run Linux so I can't create a version for those.
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*