Page 1 of 1
Help with the GUI toolkit
Posted: 01 Aug 2012, 11:36
by frankie567
Hi there !
I'm currently trying to create my Manialink using the manialib framework, and i have several questions about the GUI toolkit's usage.
- First of all, is it possible to set a background color for the main frame ? I saw there was several styles in the "Manialink styles" page, but it seems that it applies only on sub-frame.
- How to display an image ? I saw there was a "setImage" function but i didn't catch the proper class to use it. I tried "Drawable", but it doesn't work.
- Is there a class or function to add a "Bookmark" button ? I searched for it, but didn't found.
Thanks for help

Re: Help with the GUI toolkit
Posted: 01 Aug 2012, 14:24
by gouxim
I'm going to create a wiki page to explain the basics of ManiaLib\Gui. I'll post the link here. If you have further questions ask them here or on the wiki pages comments and i'll complete the wiki page.
Re: Help with the GUI toolkit
Posted: 01 Aug 2012, 14:26
by frankie567
gouxim wrote:I'm going to create a wiki page to explain the basics of ManiaLib\Gui. I'll post the link here. If you have further questions ask them here or on the wiki pages comments and i'll complete the wiki page.
Ah, thank you very much

This will be very useful, as i'm quite a beginner in object-oriented programming

Re: Help with the GUI toolkit
Posted: 01 Aug 2012, 14:33
by gouxim
Note that ManiaLib is fully object oriented and rellies heavilly on PHP 5.3+'s objects features such as namespaces, late static bindings, etc. If you find yourself struggling with those concepts, a good place to start is the (very good) PHP doc about those topics:
http://www.php.net/manual/en/language.oop5.php and
http://www.php.net/manual/en/language.namespaces.php
Re: Help with the GUI toolkit
Posted: 01 Aug 2012, 16:06
by gouxim
You can start with that page:
https://code.google.com/p/manialib/wiki/ManiaLibGui
It provides a few example to build a Manialink page with the Manialink GUI toolkit.
How to display an image ?
You need to use a quad:
Code: Select all
$ui = new Quad(50, 25);
$ui->setImage('http://www.example.com/image.jpg', true);
$ui->save();
or with a relative URL:
Code: Select all
$ui = new Quad(50, 25);
$ui->setImage('./images/background.jpg', true);
$ui->save();
Is there a class or function to add a "Bookmark" button ?
First of, check this topic:
http://forum.maniaplanet.com/viewtopic.php?f=42&t=4977
Once you've figured out the URL you need, you for example do:
Code: Select all
Manialink::appendXML('<include url="http://maniahome.maniaplanet.com/add/?url=manialoto&name=%24i%24F60ManiaLoto"/>');
Re: Help with the GUI toolkit
Posted: 02 Aug 2012, 08:38
by frankie567
Thank you very much gouxim for all this stuff

It'll be very useful ! Now, i got work to do
