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

Pages: 1 2 [3] 4 5 ... 12
31
Graphics / [Solved] This Looks Right to Me, but Obviously Not...
« on: February 02, 2011, 04:01:46 am »
Haha. Check. Anything else?

32
Graphics / [Solved] This Looks Right to Me, but Obviously Not...
« on: February 02, 2011, 03:48:05 am »
Nope. Didn't work. :/ This aggravating. Haha! Does Input() require anything to run?

33
Graphics / [Solved] This Looks Right to Me, but Obviously Not...
« on: February 02, 2011, 03:37:04 am »
I would agree with you, but its not even entering the if statements, as I stated earlier. I put cout statements inside of the if statements and they never get displayed when I press the buttons. :/

34
Graphics / [Solved] This Looks Right to Me, but Obviously Not...
« on: February 02, 2011, 02:56:31 am »
Well, its supposed to be zooming over time. The longer you hold the zoom keys the more it zooms.

I was in a hurry when I posted this so I never got a chance to state the problem. NONE of input() commands even work. It won't go inside of the if statements at all.

35
Graphics / [Solved] This Looks Right to Me, but Obviously Not...
« on: February 02, 2011, 12:30:15 am »
Code: [Select]
#include <iostream>
#include <SFML\Graphics.hpp>
#include "Header\ResourceManager.h"

using namespace std;

int main()
{
    bool Running = true, Shift;
    sf::Shape Map;

    sf::View MainView;

    sf::RenderWindow Window(sf::VideoMode::GetMode(0), "Laz's Interactive Map");

    MainView.SetFromRect(Window.GetDefaultView().GetRect());
    MainView.Zoom(.1f);

    Map.AddPoint(0,0,sf::Color(0,100,0));
    Map.AddPoint(30000,0,sf::Color(0,100,0));
    Map.AddPoint(30000,90000,sf::Color(0,100,0));
    Map.AddPoint(0,90000,sf::Color(0,100,0));
    Map.EnableFill(true);
    Map.EnableOutline(true);
    Map.SetOutlineWidth(100);

    while (Running) {

        float Offset = 20000.f * Window.GetFrameTime();
        if (Window.GetInput().IsKeyDown(sf::Key::Up) && Shift == false)   { cout << "Up" << endl;MainView.Move( 0,      -Offset);}
        if (Window.GetInput().IsKeyDown(sf::Key::Down) && Shift == false)  MainView.Move( 0,      Offset);
        if (Window.GetInput().IsKeyDown(sf::Key::Left))  MainView.Move(-Offset,  0);
        if (Window.GetInput().IsKeyDown(sf::Key::Right)) MainView.Move(Offset,  0);

        if (Window.GetInput().IsKeyDown(sf::Key::LShift)) Shift = true;
        else if (Window.GetInput().IsKeyDown(sf::Key::RShift)) Shift = true;
        else { Shift = false; }

        if (Window.GetInput().IsKeyDown(sf::Key::Up) && Shift == true)   MainView.Zoom(1.005f);
        if (Window.GetInput().IsKeyDown(sf::Key::Down) && Shift == true) MainView.Zoom(0.994f);

        Window.Clear(sf::Color::Red);

        Window.SetView(MainView);
            Window.Draw(Map);
        for (int i = 10000; i < 90000; i += 10000) {
            sf::Shape Line = sf::Shape::Line(0, i, 30000, i, 200, sf::Color::Red);
            Window.Draw(Line);
        }

        Window.Display();
    }

    return 0;
}



This code looks like it should move my view. I set the view by the DefaultView.

36
Graphics / Anyone Know What is Causing This?
« on: February 01, 2011, 08:25:48 am »
I'm looking at my code and I really don't see anything that could possible cause this.... Got any ideas? It's the crushing thing again. Just any broad ideas.

EDIT: Oh my god! I just went through my entire code and never found a solution that kept my program fully operational. I fixed it once but that fix caused my key presses to quit working....

37
Graphics / Anyone Know What is Causing This?
« on: February 01, 2011, 08:22:03 am »
So the error isn't in my view code? Okay. I'll try to find it. :) Thanks.

38
Graphics / Anyone Know What is Causing This?
« on: February 01, 2011, 08:13:26 am »
Hmmm. I'm having trouble reproducing the error in minimal code... Should I just send a screenshot and view code?

39
Graphics / Anyone Know What is Causing This?
« on: February 01, 2011, 07:58:03 am »
Okay it doesn't seem to be working. I will post some minimal code within 10 minutes.

40
Graphics / Anyone Know What is Causing This?
« on: February 01, 2011, 06:01:17 am »
Oh! I see what you are saying. But how would I make it change for each different screen size its on.

I tried putting variables in as a replacement for some of the values in the sf::FloatRect but it made my program crash. :/

41
Graphics / Anyone Know What is Causing This?
« on: February 01, 2011, 04:52:31 am »
So, I'm going to have to change my view's size so it won't hold my REALLY large image?

42
Graphics / Not Using Threads
« on: January 31, 2011, 03:37:45 pm »
I am trying to move people around in an RTS fashion. I need to be able to select a shape then click somewhere for it to move and then select more people while that one is moving... Along with other actions, but movement is what I'm concerned with now.

43
Graphics / Anyone Know What is Causing This?
« on: January 31, 2011, 07:37:50 am »
I'm sure I'm just doing views wrong, but how would I fix this?



This should be a REALLY large image vertically. It seems to hold a 1:1 ratio along the X-Axis, but as you can see... the Y-Axis has been crushed from 90,000 to what look more like 5,000. ;( *tear*

Here is my minimal code that reproduces the error:
I'm getting good at this! ;D

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

int main()
{
    sf::RenderWindow Window(sf::VideoMode::GetMode(0), "Laz's Interactive Map");

    sf::Shape Map;
    Map.AddPoint(0,0,sf::Color(0,100,0));
    Map.AddPoint(30000,0,sf::Color(0,100,0));
    Map.AddPoint(30000,90000,sf::Color(0,100,0));
    Map.AddPoint(0,90000,sf::Color(0,100,0));
    Map.EnableFill(true);
    Map.EnableOutline(false);

    sf::View MainView;
    MainView.SetFromRect(sf::FloatRect(0,0,30000,90000));
    MainView.Zoom(.4f);

    sf::Shape Circle = sf::Shape::Circle(5000,5000,2500,sf::Color::Red, 5, sf::Color::Red);

    while (Window.IsOpened()) {
        Window.Clear();

        Window.SetView(MainView);
            Window.Draw(Map);
            Window.Draw(Circle);

        Window.Display();
    }
    return 0;
}


PS: I'm am 90% sure that this is a View error... I am VERY sketchy in my views... I never know what I'm doing.

Thanks in advance.

44
Graphics / Not Using Threads
« on: January 31, 2011, 03:42:43 am »
Is there a way to make things move around on the screen (such as people) while the user does other things? I don't want to use threads if I don't have to.

45
SFML projects / The Core Passage
« on: January 30, 2011, 07:40:43 am »
@ActionBoy: Thanks. :)

@bkaxrf: Thanks for the suggestion, I will definitely take that as a suggestion if we try to remake our map maker into a random generator.

This is our first game and collaborative project, so it won't be that great, but I will be posting what we have so far in a few days. It will just be a menu and then what we have of the map and UI.

Pages: 1 2 [3] 4 5 ... 12