Tooltips

Discuss all the publishing tools, including ManiaHome, ManiaPub, ManiaFlash and ManiaPress in this forum

Moderator: NADEO

Post Reply
User avatar
kroff
Posts: 58
Joined: 15 Jun 2010, 12:34

Tooltips

Post by kroff »

Bonsoir,

Bon premièrement je vais écrire en français, j'espère que personne m'en voudra :lol: !

Voilà je voulais savoir comment ajouter une nouvelle "bulle" informative comme lorsqu'on passe la souris au dessus de l’icône de rafraichissement, qu'est-ce qu'il faut changer, ajouter, déplacer et où ! Si ce n'est pas trop compliqué non plus (j'ai quelques bases mais ça s'arrête là, c'est pourquoi j'ai choisi ManiaPress, c'est rapide, simple et efficace !).

Merci ! :thx:

[Modo] (short) English version:

I'd like to know how to add tooltips like when you mouse over the refresh icon.
Image
Image

Image
User avatar
gouxim
Nadeo
Nadeo
Posts: 1186
Joined: 14 Jun 2010, 17:20

Re: Bulles

Post by gouxim »

kroff wrote:Bon premièrement je vais écrire en français, j'espère que personne m'en voudra :lol: !
Tous ceux qui ne parlent pas français, cad la majorité ^^

Plus sérieusement, il faut éviter de parler sa propre langue sur un forum anglais, sinon ça va être le bazar.
Pour ceux qui ont des difficultés en anglais, le plus simple est peut être de procéder comme ça: Poster un message en français dans le forum en français, et demander à un bon samaritain de faire le même post anglais dans le forum anglais pour avoir des réponses en anglais.
kroff wrote:I'd like to know how to add tooltips like when you mouse over the refresh icon.
ManiaPress is built on top of ManiaLib, our open source framework. The latest version of ManiaLib has a nice and simple way of handling such UI primitives :)

But right now, ManiaPress uses and older release of ManiaLib, and it's a bit less straightforward :(

In any case, to add tooltips you need to modify the source code of the ManiaPress Theme so you have to know at least a bit what you're doing.

I'm going to soon release a new version of ManiaPress with an updated version of ManiaLib, and it will be simplier to use such features. In the meantime, here's what you can do to use it:

First, you need your manialink element to have an ID, and to have scriptevents="1". In ManiaLib, you do it like that:

Code: Select all

$ui->setScriptEvents();
$ui->setId('view-external');
See line 52: http://code.google.com/p/maniapress/sou ... ter.php#52

Then to add a tooltip to that element:

Code: Select all

 Manialink::appendScript(sprintf('manialib_ui_autotip2("view-external", "Visit the Website"); '));
See line 57: http://code.google.com/p/maniapress/sou ... ter.php#57
Please do not PM for support. Instead, create a thread so that everyone can contribute or benefit from the answer! 8-)
User avatar
kroff
Posts: 58
Joined: 15 Jun 2010, 12:34

Re: Tooltips

Post by kroff »

Yes I'm sorry ! That's just because I don't really know the computer slang (even in French), I didn't know how to explain that in english and I didn't know that these things was called "tooltips" as well ! ;)

Anyway, thanks for answering ! But I just tried it today and it doesn't seem working, anything appears ! Is that code right ?

Code: Select all

$ui = new Quad(4, 4);
		$ui->setPosition(0, -0.5);
		$ui->setImage('fb.png');
		$ui->setScriptEvents();
		$ui->setId('facebook-button');
		$ui->setUrl('https://www.facebook.com/pages/xGSRx/118631598251940');
		$ui->save();
		
		Manialink::appendScript(sprintf('manialib_ui_autotip2("facebook-button", "Notre Facebook"); '));
And I'm glad to hear that there will be a new update ! That's a really good tool, maybe a little bit underrated by the community (I didn't see so many Manailinks using it... yet !).
Image
Image

Image
User avatar
gouxim
Nadeo
Nadeo
Posts: 1186
Joined: 14 Jun 2010, 17:20

Re: Tooltips

Post by gouxim »

The code is right, but there is actually a small bug in maniaplanet and you cannot have both scriptevents="1" and a link on the icon.

Try to remove the "setUrl...." line, tooltip should appear.

There's a hack: add on the button a dialog asking to open the browser with the following code (put after the line for the tooltip):

Code: Select all

Manialink::appendScript('manialib_ui_dialog2("facebook-button", "Do you want to open your Web browser to visit this Website?", "external", "http://www.example.com"); ');
If it doesnt work, try to see if there is any error message in the ManiaScript debugger console (ctrl+g).
Please do not PM for support. Instead, create a thread so that everyone can contribute or benefit from the answer! 8-)
User avatar
kroff
Posts: 58
Joined: 15 Jun 2010, 12:34

Re: Tooltips

Post by kroff »

Yes now it works pretty good ! Actually, if I knew this bug, I'd probably not opened this topic :D But thanks anyway for your help :thx: !
Image
Image

Image
Post Reply

Return to “Ingame Publishing”

Who is online

Users browsing this forum: No registered users and 2 guests