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

Pages: 1 ... 7 8 [9]
121
Graphics / Scrolling Text..
« on: March 16, 2010, 09:15:58 pm »
I'm not sure of what you mean by "scrolling text", is that just moving the text in a vertical way?
This can be simply done by adding 3 lines of code:

Code: [Select]

#include <SFML/Graphics.hpp>
#include<iostream>

int main()
{
    // Create the main window
    sf::RenderWindow App(sf::VideoMode(703, 493), "Rahul.Reincarnated ");

    // Load a sprite to display
    sf::Image Image;
    if (!Image.LoadFromFile("image1.jpg"))
     return EXIT_FAILURE;
    sf::Sprite Sprite(Image);

    // Create a graphical string to display
    sf::Font Arial;
    if (!Arial.LoadFromFile("arial.ttf"))
     return EXIT_FAILURE;
    sf::String Text("\t \t Welcome to OpenGL Project \n \t \t \t \t \t \t \t \t \t \t \t By Rahul ", Arial, 50);

    const int SCROLL_SPEED = 20; // 20 pixels per second
    Text.SetY(-Text.GetRect().GetHeight()); // text position is just above the screen
   
    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::Escape))
                App.Close();
         }
         // increase Y axis, move down
         Text.Move(0, App.GetFrameTime() * SCROLL_SPEED);
         
         // Clear screen
         App.Clear();

         // Draw the sprite
         App.Draw(Sprite);

         // Draw the string
         App.Draw(Text);

         // Update the window
         App.Display();
     }

    std::cout<<" thank you for using the program ";
    getchar();

    return EXIT_SUCCESS;
}

122
SFML projects / CosmoScroll - space shooter game
« on: March 14, 2010, 10:51:28 pm »
Thanks for the feedback.
Quote from: "gsaurus"
What did you use to play mod songs?

We used the DUMB library, and a SFML wrapper around it (source is available here).

123
SFML projects / CosmoScroll - space shooter game
« on: March 13, 2010, 04:38:59 pm »
Here is Cosmoscroll, an horizontal-scrolling space shooting game written in C++/SFML.

This space shooter features space bandits, aliens and various power-ups.
Cosmoscroll comes in two flavors:
  • Story Mode : Complete all levels, beat the final boss and unlock the hardcore version!
    Collect credits and use them for upgrading your spaceship and buying better weapons.
  • Arcade Mode : Hold as long as possible against more and more powerful bad guys.
    Try to establish a new high score and share it online to compete against other players!
    Don't forget to upgrade your spaceship in the Story Mode for improving your score.

The game is also internationalized (english/french/german) and should load the appropriate translation file according to your system locale.







Download CosmoScroll 0.4 :
Old version for Mac OS X (0.3) : Mac OS X version

CosmoScroll is free software (GPL), source code is available on Google Code

Your comments and suggestions are welcome!.

124
Feature requests / Dependencies
« on: July 09, 2008, 04:49:37 pm »
When i compiled SFML on my Ubuntu system, i installed the following libraries :
Code: [Select]
libopenal-dev
libxrandr-dev
libsndfile1-dev

The packages list should be the same on any distribution using APT.

125
Quote from: "Laurent"
Quote from: "dewyatt"
I think sf::Window::Create should be able to take a std::wstring for the Title.

Yep.

I was about to ask for that too, great. :)
Quote from: "dewyatt"
Lastly, I believe sf::String should draw on/above the baseline, not below it.

In my opinion, it would confuse a lot of users (including me), because sf::String is like sf::Sprite and GetPosition should give the upper left corner.

126
General / Windows in Linux
« on: July 03, 2008, 04:57:46 am »
Quote from: "christoph"
for those build failures I suggest to install apt-file Wink

You can run apt-file search X11/Xlib.h and it will printout the package you need to install.

Yes, here the packages i've installed in order to compile SFML :
- libopenal-dev
- libxrandr-dev
- libsndfile1-dev
Perhaps it should be added in the "SFML and Linux (gcc)" tutorial, it's useful for Linux/APT users (Debian, Ubuntu...) who want/need to compile SFML.

By the way, the download link in this tutorial is broken : http://www.sfml-dev.org/tutorials/1.3/start-linux.php

Pages: 1 ... 7 8 [9]
anything