Help this Cocos Component reach its goal

Raised
$0.00
Goal
$20.00
0%
of goal

A downloadable Cocos Component for Windows

Get this Cocos Component and 2 more for $2.50 USD
View bundle
Buy Now
On Sale!
50% Off
$1.00 $0.50 USD or more

๐Ÿ“Œ Introduction

This component provides a flexible tooltip system for Cocos Creator. Features include:

  • Multiple show modes: normal, fade opacity, and scale popup.
  • Customizable themes with color and background sprites.
  • Smooth mouse-following tooltip behavior.
  • Works on UI nodes and world space objects.
  • Easy integration with your projects.

The system consists of two scripts:

  1. Tooltip.ts โ€“ The main tooltip manager.
  2. TooltipTarget.ts โ€“ Attach to any node to display a tooltip on hover.

----------------------------------------------------------------------------------------------------------

๐ŸŽฎ Supported Effects

  • Show Modes (configurable per Tooltip node):
ModeDescription
NORMAL Instantly shows tooltip without animation.
FADE_OPACITY Fades in/out the tooltip with adjustable opacity.
SCALE_POPUP Scales the tooltip from small โ†’ normal size.
  • Themes (affects text and background):
ThemeColor ExampleBackground Sprite
NORMAL White (255, 255, 255) normalBg
RARE Blue (80, 160, 255) rareBg
EPIC Purple (180, 80, 255) epicBg
LEGENDARY Orange (255, 180, 0) legendaryBg
  • Mouse Follow:
    • Tooltip can follow the cursor when hovering over target nodes.
    • Optional smooth interpolation for natural motion.
    • Auto-flip to prevent tooltip from going off-screen. 

----------------------------------------------------------------------------------------------------------

โœ… Installation

  1. Copy the Tooltip.ts and TooltipTarget.ts scripts into your Cocos Creator project's assets/scripts folder.
  2. Create a Tooltip Node in your scene:
    • Add Tooltip component.
    • Assign nameLabel and descLabel (Label nodes for title & description).
    • more settings
  3. Attach TooltipTarget to any node you want to display a tooltip for.

----------------------------------------------------------------------------------------------------------

๐Ÿ› ๏ธ How to Use?

Tooltip Node Setup

  1. Drag a Label for nameLabel.
  2. Drag a Label for descLabel.
  3. Drag a Sprite for bgSprite (background image).
  4. Set ShowMode:
    • Normal โ€“ instantly show/hide.
    • Fade Opacity โ€“ set start/end opacity, fadeIn/out duration, linger.
    • Scale Popup โ€“ set start/end scale, duration.
  5. Configure theme colors and sprites as desired.

TooltipTarget Node Setup

  1. Attach TooltipTarget to any node (UI or 2D world node).
  2. Configure:
    • itemName โ€“ tooltip title.
    • description โ€“ tooltip content.
    • more settings
  3. Optional:
    • autoFlip โ€“ automatically flips tooltip to stay inside screen bounds.
    • Smooth follow speed can be adjusted via smoothSpeed.

----------------------------------------------------------------------------------------------------------

๐Ÿ–ฑ Follow Mouse

  • Tooltips can optionally follow the mouse cursor.
  • Smooth follow uses linear interpolation to create natural motion.
  • Example configuration:
enableFollowMouse = true;
enableSmoothFollow = true;
smoothSpeed = 10;
offsetX = 10;
offsetY = 0;
autoFlip = true;

----------------------------------------------------------------------------------------------------------

๐ŸŽž๏ธ Test Scene

  1. Create a Canvas in your scene.
  2. Add a Tooltip Node (with Tooltip component).
  3. Create several UI buttons or sprites.
  4. Attach TooltipTarget to each node.
  5. Configure itemName, description, theme, and follow options.
  6. Run the scene. Hover over nodes to see the tooltip appear with selected animation and theme.
----------------------------------------------------------------------------------------------------------

โš  Notes

  • Only one Tooltip instance is supported per scene.
  • Make sure nameLabel and descLabel are assigned in the inspector.
  • Tooltip respects screen bounds to prevent overflow.
  • TooltipTarget automatically hides the tooltip when mouse leaves.
  • Compatible with Cocos Creator 3.x.

----------------------------------------------------------------------------------------------------------

โ“ FAQ

Q: Can I have multiple tooltips at once?
A: No. This system uses a singleton pattern; only one tooltip shows at a time.

Q: Can I change the tooltip dynamically at runtime?
A: Yes. Call Tooltip.show(name, description, worldPos, theme) to update content and position.

Q: Can I use it on world space objects?
A: Yes. It works for both UI nodes and world space objects.

Q: How do I add a new theme?
A: Add a new TooltipTheme enum value, then assign colors and background sprite in Tooltip.

Q: What happens if I disable follow mouse?
A: The tooltip will appear at the target node's world position instead.

๐Ÿ“ฉ Contact:

Discord: KEN LOO

(Add me as a friend to message)

----------------------------------------------------------------------------------------------------------

๐Ÿ“„ License

  • Allowed for use by individuals and commercial projects
  • Resale or redistribution of the source code is not permitted.

----------------------------------------------------------------------------------------------------------

โค๏ธ Support

If you encounter any problems while using it, feel free to leave a comment below. Thank you for using Tooltip Manager! More updates are coming soon!


Published 3 hours ago
StatusIn development
CategoryTool
PlatformsWindows
AuthorKEN Master
GenreAction
Tags2D, No AI
ContentNo generative AI was used

Purchase

Get this Cocos Component and 2 more for $2.50 USD
View bundle
Buy Now
On Sale!
50% Off
$1.00 $0.50 USD or more

In order to download this Cocos Component you must purchase it at or above the minimum price of $0.50 USD. You will get access to the following files:

Component Cocos Creator -- Tooltip Manager.zip 8.6 kB

Leave a comment

Log in with itch.io to leave a comment.