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.

Topics - barata

Pages: [1]
Window / Cursor Position
« on: June 13, 2014, 12:45:04 pm »
How can I get cursor position on my window or get position of window?
For example, I have screen resolution 1920x1080 and window 1280x720. My cursor position can be 1440x1050 and its bad... So, how can I get cursor position when CursorX <= 1280 and CursorY <= 720?

Graphics / Rotation Center
« on: June 11, 2014, 12:36:26 pm »
Hi! How can I set the rotation center of my sprite?

Graphics / dynamic arrays with circleshapes
« on: June 06, 2014, 02:11:59 pm »
Hello, here is my code. Im trying to write the programm which puts circleshapes on cursor position. I must use dynamic arrays. Could you say me, whats wrong and why my programm doesnt work? Thank you very much
#include <iostream>
#include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>

using namespace sf;
using namespace std;

RenderWindow app;

class CS
        CircleShape *items;
        int size;

        void Add() {
                CircleShape *newArray = new CircleShape(size);
                for (int i = 0; i < size - 1; i++)
                        newArray[i] = items[i];
                items = newArray;
                items[size - 1].setFillColor(Color::Blue);
                items[size - 1].setRadius(20);
CS circleShape;
int main()
        float xResolution = VideoMode::getDesktopMode().width;
        float yResolution = VideoMode::getDesktopMode().height;
        app.create(VideoMode(xResolution, yResolution), "1", Style::Fullscreen);
        while (true)
                if (Keyboard::isKeyPressed(sf::Keyboard::D))
                        int mouseX = Mouse::getPosition().x, mouseY = Mouse::getPosition().y;
                        circleShape.items[circleShape.size - 1].setPosition(mouseX, mouseY);
                        for (int i = 0; i < circleShape.size; i++)
        return 0;

Pages: [1]