Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: SFML game with LibRocket?  (Read 10579 times)

0 Members and 1 Guest are viewing this topic.

magneonx

  • Full Member
  • ***
  • Posts: 141
    • MSN Messenger - magnumneon04@hotmail.com
    • View Profile
SFML game with LibRocket?
« on: June 19, 2013, 03:47:19 pm »
Hello! Can I use SFML2 with LibRocket? Actually I will make a game as a college thesis. I clearly need a good looking UI for my game. Are you familiar with the games Like Red Alert 3? The UI interface looks cool! I want to make a similar gui because I am going to make a survival RTS-Route Defense game. I need it to look cheesy. Fortunately I know there is such thing like SFGUI which I could use. But I dunno, I don't think it fits my need. The GUI simply looks like a gui written in win32 API Qt or Swing. I somehow scour the web but all I see is like desktop app on a render window. I don't like that. So I saw LibRocket and saw some pics and videos in action and I am impress.

I also want to know how am I suppose to do that? I scour the web and it seems LibRocket is promising. I know LibRocket has its own way of rendering things but how can I render it using SFML? Like rendering it on sf::RenderWindow?

I also considered CEGUI but I think I will try that next time.

I hope you can enlighten me on how to do this, because up to know it simply looks impossible. I don't know if SFML2 even support it.   

Thanks

Polyfructol

  • Newbie
  • *
  • Posts: 22
    • View Profile
Re: SFML game with LibRocket?
« Reply #1 on: June 19, 2013, 06:06:17 pm »
I've never used libRocket, it looks quite interesting! Anyway, it's libRocket that needs to support SFML, not the other way ;).

And guess what I found on the libRocket repository, an SFML 2 sample ! I'm at work and I can't run the sample for now, but I think it might help you.

Grimshaw

  • Hero Member
  • *****
  • Posts: 631
  • Nephilim SDK
    • View Profile
Re: SFML game with LibRocket?
« Reply #2 on: June 19, 2013, 06:44:20 pm »
I've used libRocket a lot for many time and I don't recommend it... It will be probably painful to integrate with SFML, plus probably painful to get it to do what you want and in the end you wont be really satisfied with performance or functionality. At least if you're experience of using it matches mine :)

raycrasher

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: SFML game with LibRocket?
« Reply #3 on: June 20, 2013, 06:13:22 am »
I have tried using it with SFML 2.0 and SFML.NET, and I had very good results so far. You don't have to go far in order to make it compatible with SFML. For the renderer, just use the sample OpenGL renderer.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
AW: SFML game with LibRocket?
« Reply #4 on: June 20, 2013, 07:14:39 pm »
Yes it works, but I can't recommend it either. Not only is the project nearly dead (as stated by the dev himself), but it also contains some bad code and potential memory leaks. On top of that it fails with some compilers.
If it works for you, then go for it. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

magneonx

  • Full Member
  • ***
  • Posts: 141
    • MSN Messenger - magnumneon04@hotmail.com
    • View Profile
Re: SFML game with LibRocket?
« Reply #5 on: June 21, 2013, 06:18:31 pm »
Hello! Thanks for the replies. Yes I have went to the tutorials of Librocket, I can see it is very difficult. Rather I think I will just use SFGUI. Maybe there is a way to achieve the interface I am looking for? Someday I might try to add minimaps.

I have a lot of RTS related question, I am trying to make a subgenre of RTS, well I may not be good, but it seems like this where I am going because of the game mechanics.

I don't like gui programming to become the hurdle for my project. Anyway I will make it simple as possible. Visual graphics is not my focus anyway. I just need to find some way to implement the interface, because I think it is vital for every RTS.

I found this youtube video.
Have you seen the side panels??? Yeah that's what I want, I may want to have that kind of gui on my game.


Do you think writing that will be such a pain on my part? Or should I just make my custom widgets on SFGUI?

Thanks again.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
AW: SFML game with LibRocket?
« Reply #6 on: June 21, 2013, 07:23:52 pm »
It depends on how flexible and clean the code should be. Reinventing a whole GUI library will be a huge pain, but just getting a side panle up and running might be faster on your own, but will most likely leave you with a not very clean code design.

Afaik the progress on a bitmap renderer for SFGUI is still a WIP and SFGUI still lacks some (at least for me personally) important feature. Other than that, it is a really great library! ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

magneonx

  • Full Member
  • ***
  • Posts: 141
    • MSN Messenger - magnumneon04@hotmail.com
    • View Profile
Re: SFML game with LibRocket?
« Reply #7 on: June 22, 2013, 03:15:27 pm »
Thanks eXpl0it3r!

Alright, hmm maybe I think I stick with SFGUI. I have tried some few examples and able to integrate sfgui with sfml a long time ago. I had a great experience with that library though. Simple but yet elegant.

But I have to see how can I implement such side panel. I also wanted to make my own minimap.
I think I'll just stick with simplicity. I also need some kind of progress bar because the game I will write will contain waves.

So far all the things I need are in SFGUI, the progress bar, windows, grids etc etc. But how flexible can it be? I mean it has this default color, like grey, I wanted to implement other designs as well. Can SFGUI allow me to do it? Can I design some simple stuff by using CSS on it? Like adding a background or something? All the videos I saw is just plain and default. Or this what you are talking about: SFGUI is WIP?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
Re: SFML game with LibRocket?
« Reply #8 on: June 22, 2013, 03:30:02 pm »
So far all the things I need are in SFGUI, the progress bar, windows, grids etc etc. But how flexible can it be? I mean it has this default color, like grey, I wanted to implement other designs as well. Can SFGUI allow me to do it? Can I design some simple stuff by using CSS on it? Like adding a background or something? All the videos I saw is just plain and default. Or this what you are talking about: SFGUI is WIP?
As stated before, SFGUI doesn't have a bitmap renderer yet, it's in development, but the whole project is currently a bit on a low, due to real life taking over the developers time.
You can however change the colors by using a simple "theme" as for instance shown in the example project.

Here's an old version of the currently frozen FlexWorld project, which back then used SFGUI:


Adding a background is not directly possible with SFGUI, but you however still could add the images and set the SFGUI widget transparency to 100%, so although you only see the images you're essentially still interacting with the widgets. Keep in mind though, that his is more of a hack, than an actual solution. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

FRex

  • Hero Member
  • *****
  • Posts: 1848
  • Back to C++ gamedev with SFML in May 2023
    • View Profile
    • Email
Re: SFML game with LibRocket?
« Reply #9 on: June 22, 2013, 10:03:10 pm »
Quote
Can I design some simple stuff by using CSS on it? Like adding a background or something? All the videos I saw is just plain and default. Or this what you are talking about: SFGUI is WIP?
Style language they got is not exactly css but it's extremely close to it, maybe even fully compatible. ;D
You can change colors, fonts, per widget type, per (css) class, per (css) id, for all widgets, for all widgets that have certain parent class etc.
You can change it for states, so prelight button, pressed button, normal button etc. all have different styles.
But you can't have round corners, fancy animations or texturing of widgets, there was project(Bob) to create rendering engine that'd allow that but it kind of died.
Back to C++ gamedev with SFML in May 2023

binary1248

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1405
  • I am awesome.
    • View Profile
    • The server that really shouldn't be running
Re: SFML game with LibRocket?
« Reply #10 on: June 26, 2013, 12:47:46 pm »
Regarding bob...

Send this guy a nudge ;)

https://github.com/Iteem
http://forum.sfml-dev.de/index.php?action=profile;u=71

bob is not dead... merely sleeping for a veeeery long time :).
SFGUI # SFNUL # GLS # Wyrm <- Why do I waste my time on such a useless project? Because I am awesome (first meaning).