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

Pages: 1 2 3 [4]
46
General / Uninstalling 2.0 on OS X
« on: January 17, 2012, 02:36:12 pm »
I'm using xcode 3, I have to make a command line project, then add the libraries. How would I make an application file from this? I had an issue with load images with Texture.LoadFromFile() because where I was working wasn't the project directory or something like that. When I opened the xcode templates for 1.6 everything worked well and I could export as an application and everything fine.

47
General / Uninstalling 2.0 on OS X
« on: January 17, 2012, 10:50:47 am »
Looks like it's time to update to Lion....

48
General / Uninstalling 2.0 on OS X
« on: January 17, 2012, 09:52:11 am »
That sucks, as I'm on OS X 10.5.8 (Snow Leopard) and xcode 4 isn't available for it. How much work is it to make xcode3 templates? Or would it be easier to just update to lion?

49
Graphics / Is it possible to rotate a FloatRect to detect collisions?
« on: January 15, 2012, 07:15:14 pm »
Hay, I've been playing with FloatRect and some collisions and it's going well.  This is a simple sample I have made which draws 2 boxes, one of which is movable. It logs whether or not they are colliding. How would I edit this so that I can detect if a rotated Rect is colliding? I see that FloatRect cannot be rotated.

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

int main () {

// Setup a window and limit the framerate
sf::RenderWindow window(sf::VideoMode(640, 480, 32), "SFML Graphics");
window.SetFramerateLimit(60);

// Set up a Vector2 to hold the colliders size (this will also be the box size)
sf::Vector2f colliderSize(50.0f, 50.0f);

// Set up a Vector2 to hold boxA and boxB's positions
sf::Vector2f boxAPosition(0.0f, 0.0f);
sf::Vector2f boxBPosition(200.0f, 200.0f);

// Setup box A
sf::RectangleShape boxA;
boxA.SetSize(colliderSize);
boxA.SetPosition(boxAPosition);
boxA.SetFillColor(sf::Color::Red);

// Setup box B
sf::RectangleShape boxB;
boxB.SetSize(colliderSize);
boxB.SetPosition(boxBPosition);
boxB.SetFillColor(sf::Color::Green);

// Box B will never move in this demo, so we'll set the IntRect outside the game loop
sf::FloatRect rectB(boxBPosition, colliderSize);



// Main Loop
while (window.IsOpened()){

sf::Event event;
        while (window.PollEvent(event)){
            if (event.Type == sf::Event::Closed){
                window.Close();
}
        }

// Setup buttons
bool leftBtn = sf::Keyboard::IsKeyPressed(sf::Keyboard::Left);
bool rightBtn = sf::Keyboard::IsKeyPressed(sf::Keyboard::Right);
bool downBtn = sf::Keyboard::IsKeyPressed(sf::Keyboard::Down);
bool upBtn = sf::Keyboard::IsKeyPressed(sf::Keyboard::Up);

// Setup deltaTime and the speed in wich the boxes will move
float deltaTime = window.GetFrameTime();
float moveSpeed = 0.1f;

// Movement
if (leftBtn) {
boxA.Move(-moveSpeed * deltaTime, 0);
}

if (rightBtn) {
boxA.Move(moveSpeed * deltaTime, 0);
}

if (upBtn) {
boxA.Move(0, -moveSpeed * deltaTime);
}

if (downBtn) {
boxA.Move(0, moveSpeed * deltaTime);
}

// rectA will need to be updated everyframe
sf::FloatRect rectA( sf::Vector2f(boxA.GetPosition().x, boxA.GetPosition().y), colliderSize);

window.Clear();
window.Draw(boxA);
window.Draw(boxB);
window.Display();

if (rectA.Intersects(rectB)) {
printf("intersecting\n");
}else{
printf("not intersecting\n");

}




};


return EXIT_SUCCESS;
}

50
Graphics / Loading an image with OS X
« on: January 15, 2012, 04:11:03 pm »
It works with the full path (/Users/me/Documents/sfml/playground/assets/sprite.png")

51
Graphics / Loading an image with OS X
« on: January 15, 2012, 03:55:52 pm »
The folder where everything is stored is called "playground", and inside that I have "assets", so i would assume that LoadFromFile("assets/sprtie.png") would work, but it doesnt.

Does XCODE require me to load the file into XCODE or something like that?

52
Graphics / Loading an image with OS X
« on: January 15, 2012, 03:42:20 pm »
Hello, this might end up being an embarrassing question. I'm new to XCODE and C++, but I'm learning quickly (I have a programming background, so just learning how c++ does things is the biggest issue I'm having at the moment).

I'm having difficulty using texture.LoadFromFile(). My main main.cpp file is stored under playground/ and under here I have a folder called "assets" and within that I have an image "sprite.png". I'm trying to load this with XCODE, I use texture.LoadFromFile("assets/sprite.png") and return -1 if it fails to load the file. This always exit's the program saying it can't load the file in quesion. Is there anything else I need to do to load this file?

Thanks!

53
General / Uninstalling 2.0 on OS X
« on: January 15, 2012, 12:56:34 pm »
Thank you VERY much, I actually just stumbled across that thread.

Thanks for the help.

54
General / Uninstalling 2.0 on OS X
« on: January 15, 2012, 12:51:12 pm »
Ok, it's working now! I did write a big post here about the steps I went through and it's not working. I must had done something wrong along the way.

I'm kind of new to this so bare with me! My application is saying that "RenderWindow" doesn't have a member called "GetEvent". What has this ben replaced with?

55
General / Uninstalling 2.0 on OS X
« on: January 15, 2012, 12:29:45 pm »
Hay, I'm having difficulties getting 2.0 to work, so I wish to uninsall it and revert back to 1.6 untill 2.0 gets an official released. Can anyone share some information on doing this? Also, when 2.0 get's released we we have templates for XCODE 3 like we did for 1.6?

56
General / Installing on Mac (Xcode)
« on: January 12, 2012, 10:51:22 pm »
Hello, I followed this on OS X 10.6.8 and it installed fine! However, I don't seem to have the XCODE templates for XCODE (Version 3.2.6 (1761)).

I still have the old templates for 1.6. So when I load up a new project, and I hit "run" I get errors.

Pages: 1 2 3 [4]
anything