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

Pages: 1 ... 6 7 [8] 9 10
106
X/Y Positions of the sprites on the screen. I figure that 1920 by 1080 may have more x/y cordinates for positioning items, in compairison with 800/600. Its a lot less pixels.  ::)
You still don't understand what the view does, right? :-\

Thats obvious, but I don't know what code does what if you know what I mean, nor in the tutorial did I locate any style that had the discription "Disables window resizing." ::) If only it were that simple. xD
If you don't add the resize style you won't be able to resize it, duh! :o ::)

What do I want? I want it that I won't have to re create a image set for the at least 5 different groups of resolution. I would like it that it attempts to scale, but if it ends up throwing it out of proportion too badly
Yeah that's what I've thought. You actually want the sprites to get automatically resized (your first post implied otherwise...) but want to keep the ratio.
So you first need to read the tutorial on the sf::View and maybe you'll understand it then on your own. If not I'll maybe take more of my freetime to explain it to you further. ;D

Hope that helps. If I decide to go the long route, I may make different image sets, but that seems like a lot of added file size. :/
Depending on the supported screen sizes this can still be a good root to go, since scaling up (or down) to a big size will lose a lot of the textures quality...

Another solution is to keep the size and just change the view's size so you'll get a black frame around the game (or you can decorate the black frame of course).

So I read the sf::View tutorial today, and have a few questions...

1, there's no 3D interaction. Doesn't that make it impossible to display more rendering area without scaling it? Say for instance, not zooming or anything, but just displaying more rendering area or "view area" of the program?

2. "What you're now actually can set with setCenter is the where origin of the rendering coordinate system is put in the coordinate system of the view." ...So thats setting the center view point for the "camera" looking at the rendered sprites correct? Then in that case, any rotations would use this as the axis for the rotation?

3, "sf::View view(origin.x, origin.y, size.width, size.height);" Would that, say, if you set a larger size to match the change between standard/widescreen, be able to display more ground/menu area if the width variable is changed? Or would it just stretch it?

4, lastly, "Convert Cords" ...  Iwould like to know some more about it. I also, in it's description, am not sure what you refer to as "Point P" Say you had a rectangle for seeing if the user clicked a sprite. So you set the rectangle to the same size/position of that sprite. But then lets say the view changed, wouldn't that rectangle move with the sprite?

finally just a side question. I take it, it would not be possible, to use sf::view to rotate everything but NOT rotate certain sprites without a seperate viewport?

If any of that seems confusing, or you would like me to rephrase my questions, just ask.  ;)

I look foreward to hearing from you! :D

107
Another solution is to keep the size and just change the view's size so you'll get a black frame around the game (or you can decorate the black frame of course).

Well as I said, what would be really nice is, well, I'll just list what I'll probably shoot for quickly.

1, Atomatic changing sprites "yes I will make the bigger/smaller ones because after all, it seems a lot less tedious and probably would take less cpu than having to scale and resize a bunch of sprites... " "...Possibly have it that they do scale between, but bigger changes call for new images".... not sure yet... I'll have to think about it.

and 2, upon the window getting bigger, say, standard to widescreen, I would like to make the new two usable areas, usable instead of there being black bars, for instance, showing more map terrain or something like that. A usable map space, only instead of it being black, just increasing the render area. :) *hope I will find a way to do that.*

But yea, thats my plan.... I think.. xD

I'll just throw a call in the engine reload sequence that will automatically check the new resolution to a class that sets a flag to all other classes to properly load the correct sized images. :D

108
Oh I also forgot, how do you handle x/y positions on the window then?
x/y position of what? :o

If you mean the mouse, then there's the sf::Mouse::getPosition()...

I would rather have the window, not be able to be resized by the mouse courser and rather have it be an options menu only option. Is there a way to disable manual resize?
You haven't read the window tutorial, haven't you? ::)

o.O'' That confused me a bit...
Yeah it's a bit tricky and I'm not sure if it's worth explaining since it may not be what you want exactly (this implies the questions: What do you want exactly? ;)).

Also I still recommend to read the view tutorial because you need to know what's going on when dealing with diffrent resolutions etc. ;)

X/Y Positions of the sprites on the screen. I figure that 1920 by 1080 may have more x/y cordinates for positioning items, in compairison with 800/600. Its a lot less pixels.  ::)

I did read the window tutorial, though, I was only able to see how to enable window resizing.... I never saw anything that said anything about it having a title bar/close/minimize option, but still having no resize option. Currently the setting that is by default, is "sf::Style::Fullscreen" If that helps. But if someone wanted to run it in wondowed mode, I'm not sure on how to create the code for disabling the resize. I know that I have to figure out how to do it,  :P Thats obvious, but I don't know what code does what if you know what I mean, nor in the tutorial did I locate any style that had the discription "Disables window resizing." ::) If only it were that simple. xD

What do I want? I want it that I won't have to re create a image set for the at least 5 different groups of resolution. I would like it that it attempts to scale, but if it ends up throwing it out of proportion too badly, I may make it that instead it simply shows more area *preffered method* and just doesn't change the position of any sprites. "such as resizing them. "Not to mention I still will have to break some ground when it comes to using videos for animations in conjunction with sprites and getting the sizes properly setup. >_>"

Hope that helps. If I decide to go the long route, I may make different image sets, but that seems like a lot of added file size. :/

109
Everything is on you to make work proberly. ;)

If you don't update the view of the window when the window gets resized every sprite will appeare to have resized too, when in fact the properties of the sf::View have been changed thus making the sprites look bigger or smaller.
You can easily prevent this by reacting to the Resize event with something like the following code:
        sf::Vector2f size = static_cast<sf::Vector2f>(mWindow.getSize());

        // Minimum size
        if(size.x < 800)
                size.x = 800;
        if(size.y < 600)
                size.y = 600;

        // Apply possible size changes
        mWindow.setSize(static_cast<sf::Vector2u>(size));
        sf::View GUIView(sf::FloatRect(0.f, 0.f, size.x, size.y));
        mWindow.setView(GUIView);
This even guarantees that they can't resize the window to a smaller size than 800x600. If you have an option menu for changing the resolution this won't be necessary and you could go with:
mWindow.setView(GUIView(sf::FloatRect(0.f, 0.f, mWindow.getSize().x, mWindow.getSize().y)));

Now this will set everything to the same size, thus the content won't actually change you'll just see more or less of the whole scene. This may not be the wanted effect.
If you want the sprites to actually get enlarged but keeping the screen ratio you can do this by forcing one side to always match the other in the wanted ratio (as I force to a minimal size) and not changing the view to keep the scaling.

As a side note: If the view doesn't match the window 1:1 you can use window.convertCoords() to match the mouse position with the view position.

If you have trouble understand the view you should take a look at my tutorial: Using sf::View

Oh I also forgot, how do you handle x/y positions on the window then?

I would rather have the window, not be able to be resized by the mouse courser and rather have it be an options menu only option. Is there a way to disable manual resize?

Quote
If you want the sprites to actually get enlarged but keeping the screen ratio you can do this by forcing one side to always match the other in the wanted ratio (as I force to a minimal size) and not changing the view to keep the scaling.

o.O'' That confused me a bit...

110
Hello all! :D

When my program launches, it detects the screen resolution, and full screens to that resolution. The only problem I have with this is the following:

1, If I used big graphics "for making the game on a big resolution" and they have a small screen, the images will look huge "at least I think they will".

2, If I make my images for lets say, 1920 - 1080 and someone changes the resolution to a standard, like 800 - 600. Then the sprites width will be resized more than its height causing deformities in the images.

So I'm not really sure how to handle these senarios and am looking for guidence/ideas that may work to hopefully, make it that I won't have to create a new image set for the whole game, for every possible resolution. "Because at this point it seems like that may be required." -_-'' So I figured I should worry about this before incorperating a menu screen or the rest of the game.

Anyways, I look foreward to hearing from you!

~Flash619

111
It has nothing to do with the Genesis class... ::) :P

xD I figured it was in Genesis considering that two seperate classes had the same issue, and the only similarity was where they were called. I never checked the enum though.  ::)

112
You say its not needed, but let me tell you, Visual Basic will let me know if its not there. -_-
Visual Basic? ??? ;D
That's because you didn't create an empty project, as you should have. ;-)
You can also disable it in the project settings.

Anyway, hace you tried to comment out the enum decleration?

I meant Visual Studio. Haha, oh visual basic... good times.

I just did, still has the same error. :|

OH WOW, found the error. In my Enum for Genesis's state, I used "MainMenu" in it, so it keeps expecting that when I say "MainMenu" I'm refering to the Enum, and not the class. I'll change the enum to "showingMainMenu" to resolve this. Thanks a bunch!

113
"MainMenu.h" or "MainMenu.hpp"?  ::)

DJ

The file extension for the header files for visual studio is by default ".h"

I fixed it to avoid further confusion. :)

ALSO, I have been trying to find the source of this error for several days. I can completely blank MainMenhu.h of everything except the class itself, same error, blank out MainMenu.cpp, same error, Delete everything in Genesis.cpp besides the method calling MainMenu, same error.

114
Is the provided code really the full code (e.g. Genesis class)?

You should remove everything step by step at the position where it doesn't produce an error any more start searching.

Also the use of stdafx.h isn't really needed... ;-)

You say its not needed, but let me tell you, Visual Basic will let me know if its not there. -_-

I figure it has nothing to do with genesis.cpp since every other time I used similar code in the file, it never error'd except for once. Which once again, made no sense considering I could put code right above it that did the same thing for a seperate file, and it would work prefectly as I showed above.

I mean, everhting is there, its including the header, everything that needs a ";" has one, the classes are all setup, the file has no visable errors, or any compile errors, except for this one error that I have never, been able to get rid of.

EDIt

Also, I deleted everything else in the file to only this:
Genesis.cpp
#include "stdafx.h"
#include "Genesis.h"
#include "MainMenu.h"
#include "BetweenScreens.h"
#include "SplashScreen.h"
#include "WindowEngine.h"
void Genesis::loadMainMenu(sf::RenderWindow& renderWindow)
{
        BetweenScreens betweenScreens; //<------Still works fine
        betweenScreens.LoadingMenuScreen(renderWindow);
        MainMenu mainMenu;                  //<--------Still has an error.

}
 

115
The error is a strange way to say: "MainMenu is undefined here".
Are u including MainMenu.h in the file where you are getting this error?

Yep.
#include "MainMenu.h"
 
:) Any other things that could cause it?

116
I have a bit of an issue. I'm trying to make my objects and everything, but I always run into this error. No, not always. Just with these two files, MainMenu.cpp/hpp and SplashScreen.cpp/hpp.

I'll try the following code like:
MainMenu mainMenu;
 

Imediatly it says ther there is a missing ";" before the identifier mainMenu, when I hover over it, Visual Studio pop's up with "Error, Expected a ";""

I've looked at my files, and they look just fine, I'll show  MainMenu.cpp and .hpp

MainMenu.cpp
#include "stdafx.h"
#include "MainMenu.h"
void MainMenu::GetResult(sf::RenderWindow& renderWindow)
{
        //Not yet finished...... obviously.
}
 

MainMenu.h
#ifndef MAINMENU_H
#define MAINMENU_H
class MainMenu{
public:
        void GetResult(sf::RenderWindow& renderWindow);
        enum MainMenuResult{Play,Quit,Load};
};
#endif
 

Now I know how this error can kinda roll down from any linked file, so I'll also show stdafx

stdafx.h
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//

#ifndef STDAFX_H
#define STDAFX_H

#include "targetver.h"

#include <stdio.h>
#include <tchar.h>
#include <iostream>



// TODO: reference additional headers your program requires here
#include <SFML/Audio.hpp>
#include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>
#include <SFML/System.hpp>

#endif
 

As I said, I can't find were its saying I'm missing an ";". To me the whole error really makes no sense. I mean, it works with BetweenScreens, and thats just a bunch of random public methods for loading screens. So, yea, I look foreward to hearing if anyone else ever had this issue.

Yes, I used google, but the problem seems to have a unlimited ammounts of fixes/causes so it wasn't much help.

Anyways, let me know what you think, and have a wonderful day! :D

EDIT, oh almost forgot the original position of the erroring code in the main file:

void Genesis::loadMainMenu(sf::RenderWindow& renderWindow)
{
        BetweenScreens betweenScreens; //Works Fine
        betweenScreens.LoadingMenuScreen(renderWindow);
        MainMenu mainMenu; //Error   ...and will still error if I got rid of the above code.

}
 

117
Then you must have somehow changed the default working directory (unless you always start your application without the debugger...). ;-)
You can find the settings in Project->Settings->Debugging

Oh wow, turns out I changed that while trying to fix it. I reset it to default. We're good now, thanks for the assistance! :D

118
AHA! Figured out that they need to be in

"Visual Studio 2010\Projects\Genesis\Genesis\Debug"

Now time to see if I can modify debug/release to use the same resource path! :D

119
So if your resouces are in a folder you also set the file paths in the code, right?
(E.g. you got the folder "res" with the image "img.png" so you wrote texture.loadFromFile("res/img.png"); )

Do you get errors in the console or do the resouces just not show?

"Recource/SplashScreen/PredawnStudios/predawn_splash.theora.ogv" //How I locate my files.
 

Quote
FFmpeg error: unable to open file Recource/SplashScreen/PredawnStudios/predawn_splash.theora.ogv

The same will happen for any images/audio files.

If I go to were the .exe was output, and double click to run it. It runs fine without errors. Only when launched by visual studio, will it not find anything it needs.

 ??? Haha, you see my confusion? XD

Just tried searching the forum.... I wasn't sure what search string to use, but I didn't find anything through the search function. >_< Oh well, that could be due to bad topic names though.

I'm still diging through project settings, but I'm not finding anything that says "Path to resources". Hahaha, oh boy.

120
I wonder what you were googling for, because this question gets asked about every week in here... ::)

VS searchs for resources in the project folder, this is where the *.vcxproj file can be located. The working directory (or if wanted the build directory) can be changed in the project settings.

If you don't change anything you'll just have to place your resources next to the project file and you're good. :)

Well, I copied my resource folder right next to the vcxproj file. I still have the same issue yet. I looked in the project settings, but really have no clue what settings I'm looking to change.  :-\ I don't even know if I want to change settings, because having one resource folder seems nice if it can be done that way. Still I've tried placing the resource folder in both the debug, and release folders, the root project folder, and the folder with the "vcxproj" file. Not sure what I'm missing...

Also, I just think its odd that the .exe is put in the /debug/ folder but that it looks for resources in the folder /../MyProject.

Anyway, let me know what you think is going wrong. *sigh* if it wasn't for problems like these, I could actually do something.

Pages: 1 ... 6 7 [8] 9 10