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 - wvtrammell

Pages: 1 2 3 [4] 5
46
Graphics / pixel color
« on: February 19, 2011, 03:40:28 pm »
I really appreciate what you fellows are trying to do for me but, This October I will be eighty eight years young and I doubt if I will ever be a programmer in any language.  I am able to sit at the keyboard and type in simple code and enjoy watching it execute.  If someone would just add the lines of code to the above so I can compile and execute it I would be extremely grateful.
Thanks for your time.
Warren Trammell

47
Graphics / pixel color
« on: February 19, 2011, 12:09:18 am »
If it is so simple, how about showing me the code?
Thanks
Warren

48
Graphics / Pixel color
« on: February 18, 2011, 09:48:51 pm »
Thank you for pointing me to the documentation.
With my limited experience I have no idea how to write the code I need?
Warren

49
Graphics / pixel color
« on: February 18, 2011, 05:15:05 pm »
Code: [Select]
#include <SFML/Graphics.hpp>

int main()
{
    // Create main window
    sf::RenderWindow App(sf::VideoMode(640, 480), "SFML Graphics");

    // Start game loop
    while (App.IsOpened())
    {
        // Process events
        sf::Event Event;
        while (App.GetEvent(Event))
        {
            // Close window : exit
            if (Event.Type == sf::Event::Closed)
                App.Close();
        }

        // Clear screen
        App.Clear(sf::Color(128,128,255));

        // Draw apredefined shape
        App.Draw(sf::Shape::Circle(200, 200, 100, sf::Color::Yellow, 10, sf::Color::Blue));

        // Finally, display the rendered frame on screen
        App.Display();
    }

    return EXIT_SUCCESS;
}

Will someone please add the lines of code required to get the color of the pixel at x = 100, y = 100?
I can not find it in the tutorials.
Thanks a bunch.
Warren

50
General discussions / Thanks
« on: January 27, 2011, 06:37:14 pm »
Thank you
Warren

51
General discussions / Graphics vs window based
« on: January 27, 2011, 05:26:13 pm »
I have done some simple C++ on a MAC with an Intel processor and now wish to try SFML.  I down loaded and installed and down loaded the tutorial Getting Started.  It is very good but I have one question.  What determines whether I choose Graphics based or Window based option?
Thanks
Warren Trammell

52
Graphics / Key Pressed
« on: October 28, 2010, 10:14:56 pm »
Let me ask this question:
How does circles get drawn and displayed if the only signals received are from the mouse button:
Is this an error in SFML Lib or resulting from clobbered software on my machine?
Thanks
Warren

53
Graphics / Key Pressed
« on: October 28, 2010, 07:10:40 pm »
Hi
Can some one tell me why pressing the up key and moving the cursor has the same effect in the following code:



Code: [Select]
#include <SFML/Graphics.hpp>


int main()
{
    srand((unsigned int)time(NULL));

int x, y;

// Create main window
    sf::RenderWindow App(sf::VideoMode(1200, 800), "SFML Graphics");

// Change color of background
App.Clear(sf::Color(128,128,128));
App.Display();



// Start game loop
    while (App.IsOpened())
    {
        // Process events
        sf::Event Event;
        while (App.GetEvent(Event))
        {
            // Close window : exit
            if (Event.Type == sf::Event::Closed)
                App.Close();
       

   if((Event.Type == sf::Event::KeyPressed) && (Event.Key.Code == sf::Key::Up));
   {
       x = rand() % 1000 + 50;
       y = rand() % 600 + 50;

        // Draw a shape
       App.Draw(sf::Shape::Circle(x, y, 50, sf::Color::Red));

        // Finally, display the on screen
       App.Display();

    }

}

    }

    return EXIT_SUCCESS;
}


Thanks
Warren

54
Graphics / Event
« on: October 28, 2010, 04:47:23 pm »
Which is proper to use in graphics:

If(App.GetInput().IsKeyDown(sf::Key::F1))

or  

if(Event.Type == sf::Event::KeyPressed):: && (Event.Key.Code == sf::Key::F1))

They both appear to function.

Thanks
Warren

55
Graphics / Colors
« on: October 22, 2010, 09:57:18 pm »
Thanks
Warren

56
Graphics / Colors
« on: October 22, 2010, 07:51:38 pm »
Where may I find a list of the colors SFML will accept, Red,Blue, etc.
Thanks
Warren

57
Graphics / determine color
« on: October 16, 2010, 05:14:12 pm »
App.Draw(sf::Shape::Circle(x,y,radius,sf::Color(255,0,0)));
App.Display();

The above code will place a red circle on the screen.
Is there code that I can use to tell me the color the circle?
Thanks
Warren

58
Graphics / Variables as colors
« on: October 12, 2010, 07:47:54 pm »
Define random colors and use them to draw circles.

59
Graphics / Variables as colors
« on: October 12, 2010, 06:42:39 pm »
Is it possible to:
int a = 255, b = 128, c = 37;

sf::Shape::Circle(x,y,radius,Color(a,b,c));

Thanks
Warren

60
Graphics / Variables in App.Draw
« on: June 29, 2010, 09:53:30 pm »
This worked great so I decided to use it in an IF statement (enclosed).
It compiles but is ignored in execution.
What am I doing wrong please?
Warren

Code: [Select]
#include <SFML/Graphics.hpp>

int main()
{
int x = 150, y = 450, random = 5;

    // Create main window
    sf::RenderWindow App(sf::VideoMode(1400, 900), "SFML Graphics");

    // Start game loop
    while (App.IsOpened())
    {
        // Process events
        sf::Event Event;
        while (App.GetEvent(Event))
        {
            // Close window : exit
            if (Event.Type == sf::Event::Closed)
                App.Close();

    //Escape key exit
    if((Event.Type == sf::Event::KeyPressed) && (Event.Key.Code == sf::Key::Escape))
    App.Close();
   
//F1 key pressed
    if((Event.Type == sf::Event::KeyPressed) && (Event.Key.Code == sf::Key::F1))
    App.Close();
}

        // Clear screen
        App.Clear(sf::Color(128, 128, 128));

sf::Color grn(0,255,0);
if(random == 5)
{
sf::Color grn(255,215,0);
}

App.Draw(sf::Shape::Circle(x,y,50,sf::Color(grn)));

        // Finally, display the rendered frame on screen
        App.Display();
    }

    return EXIT_SUCCESS;
}

Pages: 1 2 3 [4] 5
anything