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

Pages: [1] 2 3 4
1
SFML projects / Re: Immortui - 2D top down zombie puzzle/shooter game
« on: June 30, 2013, 12:39:00 am »
Huh. It crashed when pressing play? That hasn't happened for anyone I've tested it on! What OS are you on, and did you try it more than once?

EDIT: Partially sorted out on IRC. If anyone else has this bug, it appears that disabling particles, loading the game, then reenabling them fixes the problem. I'll try and get to the bottom of this bug tomorrow, but it may be difficult as I cannot reproduce it on my machine.

2
SFML projects / Immortui - 2D top down zombie puzzle/shooter game
« on: June 29, 2013, 03:09:05 pm »
I've been working with SFML to create this zombie puzzler on and off for a few months, and it's now been released on Desura!

I was working with an SFML 2 RC and TGUI to create this game, so as I neared the ending I tried to upgrade to the latest SFML and TGUI with success. Unfortunately I did not manage to port to linux or Mac. My lack of any experience with linux made compiling it extremely difficult for me, and once I had finally worked out how to use linux and its compilers, my code would compile but not run from some memory error. I did not port to mac because the mac I was going to compile everything on actually (physically) broke the day before I was going to!

If you are interested, check out the game's site. As I mentioned the game is on Desura and this site has a link to the Desura purchasing.
http://immortui.hogpog.co.uk


3
Graphics / Re: Sizing RenderTexture resizes graphics
« on: October 29, 2012, 04:48:55 pm »
I understand now!  ;D Thanks!

4
Graphics / Re: Sizing RenderTexture resizes graphics
« on: October 29, 2012, 04:11:30 pm »
I incorrectly understood your answer as not understanding my problem. :(

I have read the documentation and the wiki - I may understand something incorrectly. As I understand, in my scenario the view will display a portion of the rendertexture. The mental image I have of what's happening is the 3rd image, and you say it is wrong - what does actually happen?

5
Graphics / Re: Sizing RenderTexture resizes graphics
« on: October 29, 2012, 03:55:32 pm »
Quote
rendertexture.setView(minimap)
should be window.setView(minimap). Edited.

Quote
What's displayed in your render-window is defined by the view. If you make your render-texture larger but don't change the view, things will just get stretched.

Here is an image - hopefully this will explain what I mean:


6
Graphics / Sizing RenderTexture resizes graphics
« on: October 29, 2012, 02:51:57 pm »
As I am using multiple views of the same screen I am drawing to a RenderTexture, which I then draw to the RenderWindow. At the beginning of my program the RenderTexture is created to twice the size of the window. I was expecting my rendering area to be increased (e.g. so the size of  the window was 600x600 but I could render to this texture at (800,800) ), but instead when I draw all my graphics were scaled up - so my 32x32 sprites became 64x64, and the positions were scaled - creating the RenderTexture double the size just stretched it.

Here is what I'm doing each rendering frame (in pseudocode):
rendertexture.clear()
window.clear()
rendertexture.setView(view)
rendertexture.draw(all)
rendertexture.display()
window.draw(rendertexture)
window.setView(minimap)
window.draw(rendertexture)
window.display()

I'm trying to have the minimap display the same screen as the main view except the area that is shows is double the size. If the RenderTexture didn't stretch I would be able to do this (SFML 2, but not the most up to date version).




7
Graphics / Re: Drawing darkness around player
« on: October 19, 2012, 06:58:32 pm »
Set Blendmode to BlendNone

I have done

m_lighttexture.create(200,200);

        m_lighttexture.clear();

        sf::CircleShape temp(100);
        temp.setOrigin(100,100);
        temp.setFillColor(sf::Color(255,255,255,1));
        temp.setPosition(sf::Vector2f(100.f, 100.f));
        m_lighttexture.draw(temp, sf::BlendNone);

8
Graphics / Re: Drawing darkness around player
« on: October 16, 2012, 11:40:57 pm »
I'm drawing my circle to be transparent, and the texture I am drawing is filled in black. So the circle is transparenct by the areas outside of the circle but still inside the texture is black.

9
Graphics / Re: Drawing darkness around player
« on: October 16, 2012, 07:56:32 pm »
Hmm. For some reason changing opacity from 0 to 1 fixes the problem... However, I still have an issue: when the game is not dark but the player-light is there, there are black parts where the rectangle surrounds the circle, which is an issue as i'm moving around. Is there any way of fixing this?

10
Graphics / Re: Drawing darkness around player
« on: October 15, 2012, 10:42:56 pm »
If you don't want the nice effect, just draw one single sf::CircleShape onto the sf::RenderTexture instead of many, i.e. replace the generateSpot() function from my example.

If you have trouble you should tell use where exactly and not just post the code and let us search where things go wrong... ;)

Btw your code-tag formatting is broken.

Formatting fixed. Sorry, I thought made it clear - in the init_light function, I drew the single circle like you suggested but it comes out black like I said.

11
Graphics / Drawing darkness around player
« on: October 15, 2012, 09:58:25 pm »
I have read a thread about this: http://en.sfml-dev.org/forums/index.php?topic=9320.0 but, even after looking at the example, I am unable to add this into my game.

I want a circle of just transparency - no white borders, or any pretty effects - to follow the player. The darkness layer will not always be present, as it needs to slowly fade in/out, so the rectangle which the circle is drawn on needs to be black and the same opacity as the darkness layer.

Here is what I have so far:

//class Darkness
sf::RenderTexture m_Layer;
        sf::RenderTexture m_lighttexture;
        sf::Sprite m_Sprite;
        sf::Sprite m_light;

/////
m_Layer.create(view->getSize().x,view->getSize().y);
        init_light();

void Darkness::init_light(){
        m_lighttexture.create(100,100);

        m_lighttexture.clear();

        sf::CircleShape temp(50);
        temp.setOrigin(50,50);
        temp.setFillColor(sf::Color(255,255,255,0));
        temp.setPosition(sf::Vector2f(50.f, 50.f));
        m_lighttexture.draw(temp, sf::BlendNone);

        m_light.setTexture(m_lighttexture.getTexture(),true);
        m_light.setOrigin(50,50);
}

and

void Darkness::render(){
        m_Layer.clear(sf::Color(0,0,0,opacity));
        if(displaylight){
                m_Layer.draw(m_light,sf::BlendNone);
        }
        m_Layer.display();

        m_Sprite.setTexture(m_Layer.getTexture());
        Game::window->draw(m_Sprite);
}

What happens is there is a black rectangle on top of the player at all times - not transparent.

12
SFML projects / Re: TGUI: a c++ GUI for SFML (with Form Builder)
« on: August 26, 2012, 07:16:25 pm »
Quote
Following the link from the website gave me the linker errors and the latest github page gave me build errors.
The one on my site is just a link to the one on GitHub. Are u sure that you aren't downloading the master branch?
You do have the latest sfml version, right?

Anyway, this has to be solved and it seems to be something on your side because I don't have this problem.
Could you send me the libraries and dlls that you have build and a small test code to reproduce it?

I'll try again later. Right now I have a game to make ^^

13
SFML projects / Re: TGUI: a c++ GUI for SFML (with Form Builder)
« on: August 26, 2012, 06:54:06 pm »
It was the 0.5 dev version. Following the link from the website gave me the linker errors and the latest github page gave me build errors. I tried redownloading/building it 3 times and I still got the same errors. =/

14
SFML projects / Re: TGUI: a c++ GUI for SFML (with Form Builder)
« on: August 26, 2012, 06:29:03 pm »
The latest version on here: https://github.com/texus/TGUI (when I pressed 'download this repository as a zip file') produced a few build errors but I can't remember them - I have now reverted to an older version. There was something about return type being invalid. I think I remember something about a font not being able to be returned as a const when it was a pointer... or something :)

I'm linking dynamically on Windows 7, Visual Studio 2010 express.

15
SFML projects / Re: TGUI: a c++ GUI for SFML (with Form Builder)
« on: August 26, 2012, 05:38:31 pm »
I'm getting "tgui::LoadingBar has no member 'setText' " with the newest version. Not sure if it's my fault but I thought I built it correctly.

EDIT: No mention of "setText" in LoadingBar.cpp. Maybe I should redownload the source.
EDIT #2: Fixed now.
EDIT #3: Unresolved external symbols - OBJECT::textEntered(char) and Label::draw

Ah. Nothing I am doing is changing this last problem - I rebuilt it, debug/release are matching with the CMake options, and I'm getting unresolved symbols as described above. Is this a bug or am I still doing something wrong? (would appreciate a quick answer as I'm using this as part of Ludum Dare, 48 hour game making competition, and I only have 9 hours left).

Tried the latest gitHub TGUI and I get build errors. Going to go back a version...

Pages: [1] 2 3 4