Mouse over tooltip component

A place to post your custom classes and engine extensions to share with the community.

Mouse over tooltip component

Postby foolmoron » Fri Dec 13, 2013 7:41 pm

Here's a simple thing I just made for my game:
http://i.imgur.com/Athmuzg.png
http://pastebin.com/c8RX3hw4
A basic mouse over tooltip

Basically you add the component to an entity, and when you mouse over, an IgeUiLabel styled using the new CSS-like styling system will pop up with some text, and when you mouse off, it disappears. Easy way to add small amounts of unobtrusive information.

Ex:
Code: Select all
//just add the component to an entity
this.sharebutton = new IgeUiEntity()
   .addComponent(MouseOverTooltipComponent)
   
//the source file describes the options you can pass, including the text and the style
this.sharebutton = new IgeUiEntity()
   .addComponent(MouseOverTooltipComponent, {text: "Tell your friends about this game!", style: {color: "#00ff00", width: 120, top: 0, left: -130})
foolmoron
 
Posts: 57
Joined: Thu Oct 24, 2013 7:20 pm

Re: Mouse over tooltip component

Postby rob » Wed Dec 18, 2013 7:23 pm

Fantastic, thanks for the share!
CEO & Lead Developer
Irrelon Software Limited
http://www.isogenicengine.com
User avatar
rob
Site Admin
 
Posts: 316
Joined: Tue Oct 22, 2013 5:08 pm


Return to Custom Code

Who is online

Users browsing this forum: No registered users and 1 guest
cron