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 - Kain Nobel

Pages: [1] 2 3
1
Graphics / Re: Facilitating Rich Text Formatting
« on: March 02, 2023, 10:55:21 am »
That's too cool, thank you!

I'll have to check this out and see how it works, looks like it would facilitate the functionality I need :D

2
Graphics / Facilitating Rich Text Formatting
« on: March 02, 2023, 08:21:00 am »
Hello and good day!

This is just a general question, not a specific "tech support question", but it does relate to the SFML/Graphics library. I'm needing to do a specific task and I'm trying to brainstorm the best possible solution. The solutions I'm coming up with in my head sound OK-ish, but maybe you'd have a better one?

I'm curious if there is a way to facilitate rich text formatting with the sf::Font and the sf::Text objects, as-is, or if I'd have to come up with a solution from scratch.

Standard Font / Text Operation
Code: [Select]
//Load the font
sf::Font font;
font.loadFromFile("Impact.ttf");

// Apply text settings
sf::Text text;
text.setFont(font);
text.setString("Hello, world!");
text.setCharacterSize(24);
text.setFillColor(sf::Color::Red);
text.setStyle(sf::Text::Bold | sf::Text::Italic);

The way I'm understanding this is the sf::Text is actually the object that determines such things as Bold and Italic flags. As far as I see, doing something like...

Hello World!

...is perfectly feasible. But what if I want to do...

Hello World!

Is this type of operation supported without having to use multiple sf::Text (or multiple sf::Font, etc) objects?

The way I'm wanting it to work VS the way the library actually works seems a little different...

How I'd Like It To Work (Example)
Code: [Select]
Iterating Letter-By-Letter Operations...
    Font = Font(...properties...)
    Toggle Bold (On)
    Set Color(0, 96, 0)
    Write "H"
    Toggle Bold (Off)
    Set Color(48, 128, 48)
    Write "ell"
    Set Color(0, 96, 0)
    Write "o"

   //...Blah blah blah...
End Iteration

The raw sf::String itself would probably look like...

Code: [Select]
"\b\c[1]H\c[2]\bell\c[1]o \bW\b\c[2]orld\b\c[1]!\c[0]\b"
That's a dumb example, but I'd need to iterate through each letter and look for codes within the string that would change the format of the rendered text product. It would format based on escape codes such as \b (toggle bold), \i (toggle italic), \c[0] (change font color), etc. As the iterator rolls forward, each letter would be drawn and specified changes of formatting would be applied.

What I'm Needing This For...

The reason I'm needing this is so I can write a Rich Text Message System. As each character is written onto the texture, letter by letter, the properties would always be subject to change during runtime. At any moment, a Bold could be switched on, an occasional Underline may be applied, font name can change, etc.

The only workaround I can think of is using individual font.getGlyph calls and rendering them to an sf::Texture. I'm thinking the sf::Text object would also have to come into play for bolds, italics, etc. Each individual letter would probably have to be rendered on a buffer, and then transferred onto the main "text display" texture.

Hopefully I'm overthinking this and somebody is experienced enough to suggest a better solution than the one I have in my head. Not that I think my purposed solution is bad, but I feel there may be a more direct way to facilitate the behavior I'm looking for.

Thank you ahead of time to anybody who reads this, looking forward to hearing back.

3
General / Re: Fresh Start II / Application Window Doesn't Launch [Solved]
« on: February 27, 2023, 07:46:13 am »
I appreciate your help, sorry I had to leave for a bit and do some adulting lol

This Build information in the two spoilers below is from the the suggestion, done exactly as stated. I've formated to the sfml-<library>-d in Linker and I've removed the \ from the end of the Search Directories (include and lib folder paths.) I tested to see if swapping them for / made a difference but it doesn't seem to.

(click to show/hide)
(click to show/hide)

Behind the scene, I've checked filepaths, made sure the compiler (TDM GCC 5.1) was good, made sure the proper files were in compiler's bin/ folder, etc. It seems to all check out.

So one thing I have discovered is it seems Code::Blocks seems to need the filepaths to be dictated by manually selecting them with the mouse. When the project is built with these settings, it unlocks 20 shiny errors of hope. In other words, I have to do...

  • "lib\libsfml-graphics-d.a"
  • "lib\libsfml-window-d.a"
  • "lib\libsfml-system-d.a"

...and I get...

(click to show/hide)

And that's all I've got for now.

NOTE: These are the next steps, then I'll be updating the topic.

  • Uninstall / reunstall Code::Blocks 20.03, just to rule out faulty IDE / components.
  • Uninstall / reinstall TDM 5.1.0 compiler, just to rule out if it's faulty or not.
  • Replacing the SFML/2.5.1/ files with fresh download, just to rule out it being faulty.
  • Triple check filepaths of things to make sure things are where things should be.
  • Stage a video from the "correct" state of configuration, then move forward experimenting with the results of different (purposely "wrong") settings and compilers to see if anything works.

EDIT: OK, so it looks like we're good now. I did have to uninstall / reinstall something (IDE and/or Compiler). Thank you for your help, we can stick a fork in it now :D

4
General / Re: Fresh Start II / Application Window Doesn't Launch
« on: February 26, 2023, 08:45:43 pm »
No.

5
General / Re: Fresh Start II / Application Window Doesn't Launch
« on: February 26, 2023, 07:36:40 pm »
I got it from SFML and Code::Blocks (MinGW) tutorial. The compiler is the GCC 5.1.0 TDM (SJLJ) - Code::Blocks - 32-bit. This is the compiler installed at "C:/TDM-GCC-64" (which I've renamed to 32 just now.) For TDM, there is only the 5.1 on my drive, no 10.3 exists anymore.

In my previous thread (link) I was trying to build from source. That's not the case now. That's an unrelated topic (but I may return to it because I would like to learn how to do that (again?))

6
General / Re: Fresh Start II / Application Window Doesn't Launch
« on: February 26, 2023, 06:25:52 pm »
OK looks like it is 5.1.0

(click to show/hide)

7
General / Re: Fresh Start II / Application Window Doesn't Launch
« on: February 26, 2023, 06:09:30 pm »
Ah! You might be on to something, now I'm starting to get a lot more errors. (As odd as that sounds, this might be a good thing...)

Something is incompatible it seems. Hm.

(click to show/hide)

EDIT : I've switched from GNU GCC to TDM-GCC-32 because that's what I think it's *supposed* to use, if I'm not having tutorial amnesia lol

I'm using "GCC 5.1.0 TDM (SJLJ) - Code::Blocks - 32-bit"
(click to show/hide)

The two build logs may look similar, but the 2nd one appears to have less errors (6 skipping VS 3 skipping)

8
General / Re: Fresh Start II / Application Window Doesn't Launch
« on: February 26, 2023, 05:54:15 pm »
Without "lib" prefixed: When I get an exit code 5...

(click to show/hide)

With "lib" prefixed: When I get an exit code 0...

(click to show/hide)

NOTE : OpenAL32.dll is located in Global compiler settings and is also set in the Environment Variables Path setting. I don't know if this is relevant to the situation, it might not be, but I figured I'd put the info out there in case it is of relevance.

9
General / Re: Fresh Start II / Application Window Doesn't Launch
« on: February 26, 2023, 05:22:43 pm »
OK, I did just that and now I'm getting the exit code 5 again.

I switched it back so I get the old error (exit 0 success).

I notice it does say...

Quote
"Starting the debuggee failed: No executable specified, use `target exec'."

So do I have to do something else? Sorry I'm rusty with the "setup" it's been a while lol. I'll have to get refreshed with the debugger again, I usually just do std::cout tests :3

(click to show/hide)

10
General / Re: Fresh Start II / Application Window Doesn't Launch
« on: February 26, 2023, 04:08:31 pm »
I've made a video just to demonstrate current behavior. Images of settings are in the spoilers below the video.


(I do apologize, apparently I didn't have the microphone plugged in. Shouldn't matter too much, I'm just showing the current setup.)

SFML location is @ "C:/SFML/2.5.1/", a pretty standard location.

  • Currently, the project loads and I get an exit status 0 (success.)
  • The window with the green circle (from the SFML tutorial) does not appear.
  • My console does not display the std::cout messages I've added for testing purposes.

This is a frustrating issue because I'm fairly confident I've done everything correctly. I've exhausted the tutorial and searches for similar situations via google. I'm laughing that I'm stuck on such a pedestrian issue, I've never spent so long on something so stupid lol

(click to show/hide)
(click to show/hide)
(click to show/hide)

11
General / Fresh Start II / Application Window Doesn't Launch
« on: February 25, 2023, 10:30:27 am »
(click to show/hide)

Current Situation: Everything builds correctly but no application window is launched. I got rid of the ".a" extensions in Debug and Release. I've also noticed my std::cout message doesn't get printed to the console, so hm.

Here is a video of the problem...

(click to show/hide)

EDIT: Another day, another video. The same problem, application window won't display and my std::cout statements aren't printing so something is a disconnect. I'm not sure what exactly. I'm just not cool enough for this...



(click to show/hide)

12
General / Re: 99 Problems / (Not So) Fresh Start [CLOSED]
« on: February 25, 2023, 06:57:14 am »
I'm NOT requesting a moderator to close the topic, but it is (unofficially) CLOSED.

In other words, don't expend a whole bunch of energy trying to help me in this situation. It would be unnecessary.

However, If you happen to know where those 3 compiler flags are hiding, I'd still like to know, but it no longer applies to my current situation.

Thank you and have a nice day.

13
General / Re: 99 Problems / (Not So) Fresh Start
« on: February 22, 2023, 07:08:50 am »
EDIT: Moved the ChatGPT log to the post above. It may or may not be relevant, but you can see I've been working on this issue for quite an unreasonable and unacceptable amount of time.

EDIT: I've just uploaded a video for this issue.



(click to show/hide)


(click to show/hide)
(click to show/hide)
(click to show/hide)

EDIT : I've just uploaded another video for this problem. Basically, I don't see the 3 problematic compiler flags in the context of Code::Blocks, CMake or in CMakeLists.txt.



Come to think of it, did something change in Code::Blocks? The only context I'm unable to find is one which has a ton of checkboxes related to the compiler settings. I bet I need to find the gargantuan compiler checkboxes window and uncheck these three. Usually it's as easy as finding my nose but now it's hiding so I'm wondering... did Code::Blocks remove it in an update?

Whatever. I can't spend more time looking for it tonight. Somebody will come in and, under 120 characters, probably tell me "go here, click that, click that" and I'll be like "Oh, duh! There it is LOL!"

Last Note: I'm no stranger to Discord, but I've never been able to verify or use my account. Even tonight, no dice. Somebody tried to add me: I can't add a friend. I can't even delete the thing. I'll contact the Discord admins another day, this would be my 3rd or 4th time trying in a year's span.

14
General / Re: 99 Problems / (Not So) Fresh Start
« on: February 21, 2023, 03:52:25 am »
EDIT: This might be slightly irrelevant. I'm past this step so I'm just putting it into a spoiler.

Still, I am trying to generate some usable SFML files so I can re-link them to my project again.

(click to show/hide)

Somehow I've stumbled into a circular feedback loop with ChatGPT...

(click to show/hide)

(tl;dr : The main thing of relevance in the ChatGPT log is I'm trying to figure out how to remove 3 compiler flags. The CMAKE_CXX_FLAGS entry in CMake (GUI) is blank, so I believe I have to do something within Code::Blocks to clear those flags. I've bantered with ChatGPT how to find these stupid settings in Code::Blocks. It seems the interface Build Options for the "SFML" project is different from what I have in my personal Code::Blocks project.)

15
General / Re: 99 Problems / (Not So) Fresh Start
« on: February 20, 2023, 02:31:07 pm »
OK, thank you for your suggestions and advice.



The 35 second video is just displaying the CMake configuration as-is. None of the variables have been changed. Just unpacked the 2.6.x version of SFML and will be building it with the TDM-GCC 10.3.0 compiler utility.

NOTE : One thing I noticed is it says CMAKE_CODEBLOCKS_EXECUTABLE-NOT_FOUND. Is this a problem or will it be a problem going forward? I'm using CMake (gui) on it's own to "build from source" for the SFML library so I'm assuming it's not a problem. However, I do use Code::Blocks as the IDE for my project. Let me know if I should focus on correcting this or if it's something I don't need to worry about.

NOTE : TDM-GCC-64 is the 10.3.0 version of the compiler, will this work? Do I need to get a 32 bit version of 10.3.0? The 5.1.0 is 32 bit. The package I downloaded looks to be a 32 bit package.

Can you verify that I'm not doing anything stupid? I don't want to hit "Generate" yet.

BTW Thank you for all of your help a year ago. I've managed to start a good foundation for my project using the SFML libraries. Also, I'm slightly ahead on the development roadmap. Very exciting!

Pages: [1] 2 3
anything