Menu

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.

Show posts Menu

Messages - conleec

#1
Quote from: texus on 03 September 2019, 18:58:33
It's a lot to process, but c++ isn't the most simple language to learn. And since TGUI quite heavily relies on modern c++, you might need to learn quite some things in order to properly use TGUI.

Absolutely. As they say, Rome wasn't build in a day, right?  :)

And thank you texus for confirming what I've suspected while doing this YouTube tutorial...namely that some of the code is dubious. I appreciate your guidance. I'll probably complete the tutorial series, as it gets me some hands-on experience with some working examples, but will keep your comments in mind as I move on to future projects.

And yes, pointers and reference variables still have my mind in a flip-flop. On the surface they're simple, but they get complex very fast it seems.

Chris
#2
Thank you so much for your help and explanations. Very excited about learning this stuff. Just wish I had more time, what with work, but a little bit at a time I guess.

Another question, loosely related to widget autoscaling:

On my Mac Pro tower, I have a 1920 x 1080 display and on my Macbook Pro I have a retina display with a 2880 x 1800 display.

Consequently windows displayed on the Macbook Pro are VERY SMALL.

Is there an automatic method to adjust for high density displays? Or do we need to watch for that and do the math ourselves somehow?

Chris
#3
I'm going thru an online SFML tutorial and building a very simple game. I thought as an exercise I would try to use TGUI in the project, just to expand my understanding.

Right off the bat I'm having an issue getting an instance of Gui.

In this tutorial, the small app has a Game class, a method of which creates an SFML RenderWindow dynamically like so:

Code (cpp) Select

void Game::initializeWindow() {
this->videomode.width = GAME_WIDTH;
this->videomode.height = GAME_HEIGHT;
this->window = new sf::RenderWindow(this->videomode, "My first game", sf::Style::Titlebar | sf::Style::Close);
}


Given that I have a pointer to this window object, I thought I might be able to create an accessor to it and feed it straight into the tgui::Gui initializer like so:

Code (cpp) Select

tgui::Gui gui(game.getWindow)


Or maybe even inside the Game class constructor, like this:

Code (cpp) Select

this->window = new sf::RenderWindow(this->videomode, "My first game", sf::Style::Titlebar | sf::Style::Close);
tgui::Gui gui(this->window);


How far off base am I to think that a pointer to a window object is similar to a reference to a window object, as in the online TGUI tutorial?

Code (cpp) Select

int main()
{
sf::RenderWindow window(sf::VideoMode(800, 600), "TGUI window");
window.setFramerateLimit(60);

tgui::Gui gui(&window);
...


How would one go about creating a tgui::Gui instance from a dynamically generated window within a class?

Thanks in advance for putting up with my newby-ness.

Chris
#4
Awesome! Now just a couple more questions, if you'd be so kind...

1) Would it be possible (once again, using the "many_different_widgets" example) to let the background image scale, but leave all the other widgets alone?

2) I'm assuming this is NOT possible, based on the library's architecture, but is there a way to clear the window WHILE resizing, so we don't see the widgets temporarily stretch before snapping back into aspect?

Purely academic, but I'm just trying to get get my head around all of this...

Thanks a million in advance.

Chris
#5
Hello, I'm new here and a total newbie, so please stick with me.

I'm using SFML and TGUI to learn C++ and am super excited by my progress in a few days. I've managed to build and install both, and have used CLion (on a Mac) to build the two examples. Just as a curiosity I had the same question: is it possible to avoid the autoscaling of widgets when resizing the window?

So I can get my head around it, would it be possible to explain to me, using the "many_different_widgets" example, how this would be accomplished?

Thank you so much in advance. Really looking forward to my journey.

Chris Conlee

PS: I'm not a total neophyte, just FYI. I studied computer systems engineering back in the '80s, but spent more lab time with COBOL and Fortran than C or C++. Life took me in a different direction, but am getting back to it on a hobby basis.