Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - ideal phi

Pages: [1]
1
SFML projects / ParabolaEngine - 2D Game Framework
« on: February 01, 2011, 07:50:30 am »
This is intense. I'd be glad to use this. Once you start having the major releases, I can host you at my site.

2
General discussions / SFML 2 for OS X comes true!
« on: January 29, 2011, 01:16:40 am »
Quote from: "Hiura"

Thank you, I'll have a look but I think I won't use it – I prefer do it myself even I it takes time because I don't want external dependences, but this may be to be discussed if it is very adapted to SFML joystick backend, of course.


It should be a native example. There aren't any external dependencies outside the norm.

3
SFML projects / SFUI - GUI for SFML
« on: January 28, 2011, 07:42:49 pm »
What I personally like about this library is the way GUI objects are grouped.
There is the GUI window ( such as "[Main]"). Inside the GUI window, there are GUI objects. They organize them self like a tree.  When you call gui->draw("[Main]","[Button]"), the window chosen is [Main] and the GUI object in location "[Button]" and everyone below it is drawn.
Again when you call gui->draw("[Main]","[Button]:One"), the window chosen is [Main] and the GUI object in location "[Button]:One" and everyone below it is drawn. The colon (":") act as a slash ("/") to denote a virtual folder. The same applies to poll(). There are also callbacks for several scenarios (see below).




Here what's the (messy) sample code look like:


Code: [Select]


#include <SFML/Graphics.hpp>
#include "sfui/sfui.h"
#include <iostream>

void printPressedCallback(void* n)
{
bool *bScreen = (bool*)n;
if(*bScreen)
*bScreen = false;
else
*bScreen = true;

std::cout << "printPressedCallback" << std::endl;
}

void printHeldCallback(void* n)
{
std::cout << "printHeldCallback" << std::endl;
}

void printReleasedCallback(void* n)
{
std::cout << "printReleasedCallback" << std::endl;
}

void printUntouchedCallback(void* n)
{
std::cout << "printUntouchedCallback" << std::endl;
}

void printHoverEnterCallback(void* n)
{
std::cout << "printHoverEnterCallback" << std::endl;
}

void printHoveringCallback(void* n)
{
std::cout << "printHoveringCallback" << std::endl;
}

void printHoverLeaveCallback(void* n)
{
std::cout << "printHoverLeaveCallback" << std::endl;
}

void printNoHoverCallback(void* n)
{
std::cout << "printNoHoverCallback" << std::endl;
}


int main()
{

bool bScreen = false;
sf::ui::Gui *gui = new sf::ui::Gui(sf::Color(255,255,0), sf::Color(0,0,0),sf::Color(255,255,255), 13.);

sf::ui::UIButton *button =  new sf::ui::UIButton("Switch!",13.);
sf::ui::UIButton *button2 = new sf::ui::UIButton("Switch!",13.);
sf::ui::UIButton *button3 = new sf::ui::UIButton("Button 3",13.);
sf::ui::UIButton *button4 = new sf::ui::UIButton("Button 4",13.);
sf::ui::UILabel *label = new sf::ui::UILabel("Label:",13.);
sf::ui::UICheckbox *checkbox = new sf::ui::UICheckbox(true);
sf::ui::UITextField *textbox = new sf::ui::UITextField("TextField  ",18., false, 300);

button2->setX(10);
button2->setY(60);
button->setX(10);
button->setY(120);
button3->setX(10);
button3->setY(150);
button4->setX(10);
button4->setY(300);
button4->setWidth(50);
button4->setHeight(50);
textbox->setX(10);
textbox->setY(5);
label->setX(10);
label->setY(250);

checkbox->setX(10);
checkbox->setY(180);


button->setPressedCallBack (new sf::ui::UICallBackStruct(&printPressedCallback,&bScreen));
button2->setPressedCallBack (new sf::ui::UICallBackStruct(&printPressedCallback,&bScreen));
button->setHeldCallBack (new sf::ui::UICallBackStruct(&printHeldCallback));
button->setReleasedCallBack (new sf::ui::UICallBackStruct(&printReleasedCallback));
button->setUnTouchedCallBack (new sf::ui::UICallBackStruct(&printUntouchedCallback));
button->setHoverEnterCallBack (new sf::ui::UICallBackStruct(&printHoverEnterCallback));
button->setHoveringCallBack (new sf::ui::UICallBackStruct(&printHoveringCallback));
button->setHoverLeaveCallBack (new sf::ui::UICallBackStruct(&printHoverLeaveCallback));
button->setNoHoverCallBack (new sf::ui::UICallBackStruct(&printNoHoverCallback));


    // Create main window
    sf::RenderWindow App(sf::VideoMode(500, 300), "SFUI");
App.EnableKeyRepeat(true);
gui->addWindow("[Main]",&App);
gui->addObject("[Main]","[Button]:One:Two",button);
gui->addObject("[Main]","[Button]:One:Two:Three",button3);
gui->addObject("[Main]","[Button]:One:Two:Four",button4);
gui->addObject("[Main]","[Button]:One:Three",button2);
gui->addObject("[Main]","[Button]:One:Two:Label",label);
gui->addObject("[Main]","[Button]:One:Three:Checkbox",checkbox);
gui->addObject("[Main]","[Button]:One:Three:textbox",textbox);

button->setColor(sf::Color(100,200,100));
button->setTextColor(sf::Color(255,255,0));
sf::ui::UICheckbox* ch = (sf::ui::UICheckbox*)gui->getObject("[Main]","[Button]:One:Two:Checkbox");

    while (App.IsOpened())
    {
        sf::Event Event;
        while (App.GetEvent(Event))
        {
            if (Event.Type == sf::Event::Closed)
                App.Close();
        }

        App.Clear(sf::Color(170,175,180));
gui->poll("[Main]");
if(bScreen)
{
gui->process("[Main]","[Button]:One:Three");
gui->draw("[Main]","[Button]:One:Three");
}else {
gui->process("[Main]","[Button]:One:Two");
gui->draw("[Main]","[Button]:One:Two");
}

        App.Display();
    }

delete gui;

    return EXIT_SUCCESS;
}



Download Here
There is a video there too.

4
General discussions / SFML 2 for OS X comes true!
« on: January 28, 2011, 07:02:38 pm »
If you guys haven't got the joystick working for Mac OS X, there is a sample here:
http://homepage3.nifty.com/ysflight/macdev/joystick/e.html

5
Audio / Audio from scratch
« on: September 24, 2010, 09:38:07 pm »
How would it be done without LoadFromMemory?

6
Audio / Audio from scratch
« on: September 20, 2010, 08:10:45 am »
Is it possible to create sounds from solely program generated char arrays (using the LoadFromMemory function)?

Pages: [1]
anything