Help with the GUI toolkit

Open source, lightweight PHP framework for Manialink and Web development.

Moderator: NADEO

Post Reply
User avatar
frankie567
Posts: 14
Joined: 25 Jul 2012, 09:45
Location: Saint-Etienne, France
Contact:

Help with the GUI toolkit

Post by frankie567 » 01 Aug 2012, 11:36

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.
  1. 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.
  2. 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.
  3. Is there a class or function to add a "Bookmark" button ? I searched for it, but didn't found.
Thanks for help :)

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

Re: Help with the GUI toolkit

Post by gouxim » 01 Aug 2012, 14:24

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.
Please do not PM for support. Instead, create a thread so that everyone can contribute or benefit from the answer! 8-)

User avatar
frankie567
Posts: 14
Joined: 25 Jul 2012, 09:45
Location: Saint-Etienne, France
Contact:

Re: Help with the GUI toolkit

Post by frankie567 » 01 Aug 2012, 14:26

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 :oops:

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

Re: Help with the GUI toolkit

Post by gouxim » 01 Aug 2012, 14:33

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
Please do not PM for support. Instead, create a thread so that everyone can contribute or benefit from the answer! 8-)

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

Re: Help with the GUI toolkit

Post by gouxim » 01 Aug 2012, 16:06

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"/>');
Please do not PM for support. Instead, create a thread so that everyone can contribute or benefit from the answer! 8-)

User avatar
frankie567
Posts: 14
Joined: 25 Jul 2012, 09:45
Location: Saint-Etienne, France
Contact:

Re: Help with the GUI toolkit

Post by frankie567 » 02 Aug 2012, 08:38

Thank you very much gouxim for all this stuff :) It'll be very useful ! Now, i got work to do :D

Post Reply

Return to “ManiaLib”

Who is online

Users browsing this forum: No registered users and 1 guest