I see it! draW ableS ;)Ha-ha, that's clever :D
Sounds interesting. Thanks for putting together and sharing! :)I try to share most of my stuff. Eventually ;)
The library looks pretty neat. I looked at the implementation and my implementation of the stuff I use (line and bitmap text) is pretty similar to yours, so now I'm relieved that I did things pretty okay :DThanks! Similarly, it's nice to hear that I did things the right way so it's good to know that you did it in a similar way :)
that really a cool stuffs, thanks for sharing.Thanks and you're welcome!
wiki info and min-examples are indeed comprehensive and simpified, i'm sure it will be useful for others
I see it! draW ableS ;)Bah! I was hoping it would take longer to be noticed :P!for objects
Handy stuff, and super clever name!Thank you!
Very cool stuff, indeed useful ;) Thanks, as always Hapax.Thanks. Glad you like it!
I will take a look especially at Progressbar, because that's something I want to implement in the next weeks.
Nice.Thanks!
Is that stuff you did for other projects of yours or do you develop the library as a project itself?
this is really a great news that a new version of Faux car will be out soon :)Thank you for your kind words but I would not consider myself to be "experienced".
.
The objects that I was talking about are for here (in Selba Ward) and I invented the word "generified"*. It basically meant to make more generic so that it is transportable and can be used in lots of situations.The objects that I was talking about are for here (in Selba Ward) and I invented the word "generified"*. It basically meant to make more generic so that it is transportable and can be used in lots of situations.New.As for the AI in Faux Car, I'm looking forward to eventually finishing the track drawing engine and creating a track designer so that I can hopefully eventually make a game from it! ;D
Cool stuff, Hapax! And great presentation -- especially the name is neat. :PThank you! Much appreciated :)
Progress bar looks cool! Gonna use it. :)Good to hear!
thanks for sharing it, that's cool, probably gonna use it :)Thanks! Glad you like it :)
I'd probably use a different texture to show this off, maybe some borders similar to classic Windows 95 look. Just something that feels less "stretched", even if it isn't the case. :)You're totally right. It was just a quick texture that I threw together to test it with. I'll have a look at something a little thinner around the edges ;)
Your Sprite 3D thingy is just awesome! :) :)Thank you!
I'll surely use it when i'm working on a new project. Thanks for sharing dude!
Btw, why isn't is completely symmetrical?It's the encoded data. It requires a transparent border that is one-pixel thick. In that border, black lines describe how it is to be used. The black line on the top and left show which part of the texture is to be stretched. Selba Ward's version doesn't make use of the right and bottom lines, which describe where content should go, although I will be adding a way to retrieve that information.
Oh, that's pretty clever! Stretched box looks great. :DNine Patch is really new to me - I only saw it for the first time a few days ago - but as soon as I saw it, I knew I had to implement it!
Cool thing, but I only know that technique as 9-Slice though :DThanks :)
Added new object: Console Screen ()Impressive, even the character set matches. Brings back memories of memcpy'ing junk to (far *) 0xb8000000... Only missing is blinking support ;)
()
This could be particularly helpful maybe for Slice 9(aka 9 Patch):I had a look at this. Not sure how much help you need to make Nine Patch textures, though. Just mark the black pixels where they can stretch :P
Great work Hapax!Thanks!
it looks awesome, good job :)Thanks!
Impressive, even the character set matches.I created the texture myself...from a screenshot of a Windows console after printing out the entire ASCII set:
Argh I forgot that you have to mark them with your system:DHave to? I'd argue that the convenience of just adding - visually - the area that you wish to use in a standard image file can be simpler than using meta-data along with a custom file type :P
I created the texture myself...from a screenshot of a Windows console after printing out the entire ASCII setYour efforts are greatly appreciated! It's hard to describe the joy of seeing that authentic console window :)
Hehe, I didn't intend to make it sound negative, I just forgot that you have to do it that way if you intend to use your system.No worries!)
Glad you like it :)Glad you like it :)I ().
I used it to display the code for the Ring example in front of a RingNot as cool as a console that shows the code that shows the console 8)
What about a ring console? ;DWhat about a ring console? ;DQuoteI used it to display the code for the Ring example in front of a RingNot as cool as a console that shows the code that shows the console 8)
Not as cool as a console that shows the code that shows the console 8)I suppose that's easy enough but it might be a large image and wouldn't look anywhere near as pretty!
There you go, make a sw::Quine SFML drawable!Quine seems to be beyond the scope of a drawable since the drawable itself is only an object that is drawn by the application.
What about a ring console? ;DTechnically, a ring console should be possible - and pretty easy to do:
Awesome work!Thank you very much! Glad you like it :)
It would be great to have also polylinesPolylines have already implemented as Spline (). However, giving the spline a thickness has not (yet) been implemented.
Polylines have already implemented as Spline (). However, giving the spline a thickness has not (yet) been implemented.
Nice utilities! The console is really cool! And I like the library name, too :)Thank you. I really appreciate that!.I'd like to know more about which drawables you are refering to. Most are a rather generic (SFML-style) version that should be able to be re-used. Which ones do you think would be difficult to integrate into a game? I'm interested in upgrading everything to be of more use.
Polylines are much more than lines with thickness. They have also the connection between lines and could have also a texture.Without getting too much into a debate on definitions, I didn't say that polylines had thickness. Polylines are, in fact, multiple lines connected and treated as a single object () (poly = multiple, line = straight connection of two points). Spline does this but doesn't have the ability to have thickness or texture.
Anyway your library is growing better and better.Thank you very much. I hope you find it useful :)
virtual void ConsoleScreen::draw(sf::RenderTarget& target, sf::RenderStates states) const; is not a valid declaration.Fixed ().
I'm not sure how I feel about API's complexity, especially in complex code. I have been concious of keeping the APIs relatively complex i.e. the more complex the object, the more flexibility; the more simple the object, the more restrictive.It's normal that complexity increases with functionality. What I was referring to is that the complexity of your API increases beyond that, because there are many methods for convenience. The same functionality can be easily provided with a fraction of the public methods, and I think it would help the user get a quicker overview and know what to use in which situation.
I am assuming you are referring to Console Screen when you mention create()?Yes, and I assumed it would do the same as the constructor. Based on that: create() methods that (re-)initialize the object made sense in C++98 where it was expensive to copy-assign another object. With C++11 move semantics, this is almost free, and creating a new object assures that it's in a fresh state. One doesn't need to maintain code duplication in constructor and create().
I'm not sure if or-ing enumerators is better than explicit booleans. the method should be renamed. "create" without further specifying the object leads to the assumption that a new object of the same class is created. Why not "resizeGrid"? And is that change actually needed or can the user achieve the same by creating a new object?I have to admit that I'm not fully sure why it was called create to start with. I can probably assume that it meant create new internal screen as all the internal data (the screen content) is recreated or something like that. Obviously I realised that resize() gave the impression that the size of the final visual representation would change. The method is needed as it gives the ability to change the actual content; it could be compared perhaps to changing a display "mode". Creating a new object to do just this seems to be overkill. A lot of the setup stays the same when "resizing the grid" - texture setup, colours etc..
I. ;DI think it's probably much better. I'm not even sure why I said this. I generally use enums instead of booleans at any possible occasion as who knows when its dedicated state might expand to a possible 3 or more states. It's the or-ing together that I generally avoid, though I will make an effort to involve this technique in the future.
The difference between those calls, as well as the meaning of the magic true values is impossible to know without learning the API by heart. Even when seeing the function declaration, it's still unclear what happens exactly when colors are overwritten -- which color is then used?The method is designed to be used with internal stored ("current") colours and is therefore a simple method that prints a character at the location with the current colours (as is normal in a console's display). The overrides are to allow a colour other than the current colours to be temporarily used for that single "print". The reason the booleans are also an option is to allow the ability to print at a location without changing the colours that are already at that location.
It may be overkill in this situation, but since you use a lot of foreground-background color pairs, why not treat them as first-class citizens? For example as a type with named constructor idiomAlthough the colours are sometimes available to be changed together, they refer to two completely separate things. The main (or foreground) colour is the 'important' colour whereas background colour can be relatively trivial and/or ignored. In times when the background is disabled, its colour would be useless and therefore should be able to be ignored.
interestingly, you did not use [function overloads] for one of its main purposes: type inference. There's no harm in treating single chars and std::strings the same.I think I had some trouble with calling internal methods using type inference. e.g. calling printCharAt from printAt. I can't remember fully and I'll look into maybe combining the two. It's possible I may just have been trying to be explicit. However, I can't at the moment think of a reason why I wouldn't like printing characters as also using print or printAt. I will definitely look into this.
By the way, character types should be char, not unsigned char. std::string also uses char.This was intentional as 'tiles' can also be specified by actual value and negative numbers would not be intuitive here..
What you're actually looking for are optional types. They will soon be introduced as std::optional in C++, and my library Aurora already provides them (). They're very easy to useI will have a look into optional types. I don't know much about them at the moment.
That's actually my point: I think that it should.That's actually my point: I think that it:I actually loved that you wrote this. The two options of design were both taken into consideration during development. That is, they are both evident. Obviously, they cannot co-exist comfortably so one must choose one or the other. I have not do so and I think I have tried to include the former too much while the latter is the logical choice. I will definitely make a conscious effort to be more mindful of sticking closer to latter design choice.
I don't say you should follow this style, I merely want to give you some insights in how I design interfaces in my libraries and what criteria are important to me personally.I don't say you should follow this style, I merely want to give you some insights in how I design interfaces in my libraries and what criteria are important to me personally.
-.
It is nice to see the British spelling included, as I already have to live with littering my code with words like 'color'British? ;) As a non-native English speaker, I was not biased towards one dialect. Eventually, American English's tendency of having simpler words and its bigger popularity in programming made me use it almost exclusively..It would, that's exactly what I meant with "redundancy in the API is confusing" ;)
British?I believe the "official" term is now "British English"..I).Ah, okay. The palette is only included in Console Screen. It's simply a list of colours that can be chosen by index instead of specifying a full colour each directly each time.
I understand the rationale behind using the American spellings, I just innately dislike the oversimplification of words to something which to me just looks like someone didn't know how to spell and guessed.I don't think they are "simplified"; I often find them downright confusing. It's weird when you have to translate from English to English.
and unnecessary combinations of parameter type/order:Console Screen no longer has "printCharAt", and printAt no longer accepts booleans :p (have a look at the v1.1 documentation () if you have time)
Great job! Really looking forward to the demo. :)Thank you!
And I think I'll try some things in your lib for fun, maybe I'll use them in my game or maybe I'll just learn some cool stuff thatWould be much better if you just used them, especially if you provided feedback so that they might improve. :P
I'll shamelessly stealwill inspire me to rewrite some of my own graphics code.
Hi Hapax,Hi.
Is it posible to use Selba Ward in C#.Net projects? Or will it be?
Would be much better if you just used them, especially if you provided feedback so that they might improve. :PMy game doesn't have much graphics stuff going on (and probably won't ever have....?), just some tiles, animation and simple shaders. So there's not much I need but I see how useful it can be for other people. :D
Hi and thank you for your attention to your project, Hapaxia.You're welcome and I am glad you enjoy it! :)
[...]
Thank you again for your work on SelbaWard, it's irreplaceable addition to SFML.
Kinda strange that no one had this problem before though, may be it was specific to MinGW.It's an odd thing as inline was being used to inline within the translation unit as it's a private method but since it's declaration is public in the header, it doesn't like it. This is part of the reason I've started to use more anonymous/unnamed namespaces in cpp files instead of private method where possible.
Feels bad to bother you again with questions, Hapaxia, but can I ask with what compiler and what os in mind did you designed SelbaWard?No worries. The more people inform me of things that can be done better, the better they can be done. I use Visual Studio 2015 (now) but developed most of Selba Ward using 2013. I don't have chance to test on others compilers, however, so feedback is essential to correct issues on other ones. I do aim to keep as generically C++ compatible as possible but all compilers have their quirks.
Just had multiply issues with ambiguous call to overloaded function with abs call somewhere in Sprite3d, in short it's all like in that SO question:When changing to VS 2015, I noticed that this problem appeared in my Plinth library, which should now be fixed by always using an internal abs function. As mentioned above, though, Selba Ward was mostly developed using VS 2013 and this abs thing didn't show up then and I haven't seen the problem arise yet. I'll consider options and fix it when I can. Thanks for the link.
Not sure if it's SelbaWard issue, though
I'm still promise: just after I getting my things done on that week I'm gonna do some real testing to help you with your brilliant work on Selba Ward =)Test away! Let me know how it goes :D
every .cpp that have had this issue, it's Line, PieChart, Ring, SpinningCard, Spline, Sprite3dI have patched all of these (except SpinningCard as it's old and is only included for completeness; I'll maybe tidy it up at some point or just remove it since Sprite3D is its successor) and hopefully will now no longer cause the error you were receiving.
I have considered providing a CMake file to build it as library, yes, but I am yet to have a successful experience with CMake.Maybe I could help you out build one. ;)
Looking at your screenshots, it seems that the cursor is over the s in SFML in the first one and in the bottom-right corner in the second one. Did you use "direct printing" i.e. using Cs::Begin and Cs::End? It doesn't affect the cursor so "SFML !" gets printed while the cursor stays in the top-left.Ah, I didn't know that there was a cursor! That must be it. :)
You could print without using begin and end to use the cursor or you could hide the cursor (cs.setShowCursor(false);)
it appears m_thickness isn't initialized in the Spine class.You are correct; an oversight on my part. I will fix this as soon as I can. Feel free to open an issue on Selba Ward's GitHub so I don't forget about this.
I modified SelbaWard slightly to expose the interpolated pointsAlthough Selba Ward's objects are drawables by design and creating a spline control path isn't really within that design, exposing the interpolated points could be useful in a number of ways without introducing any complications to the class. Therefore, this simple feature is now "planned" ;)
Added ability to specify initial vertices by a list of positions directly in the constructor using an initializer list (see simple examples ())That will make the syntax much cleaner.
Added ability to automatically close the spline. This also takes into account the angle connection of the first and final vertices for thick Splines:That will (probably) take care of the hitch that occurs when paths meet. I had duplicated the meeting vertex at that point.
Added ability to retrieve an interpolated position of the Spline as well as the number of interpolated positions in the entire Spline - useful for control paths:;) My particle effects much appreciate
@JayhawkZombie, I noticed you're spinning the SFML card at the beginning of your video. Are you using Selba Ward's Sprite3D? If so, consider increasing the subdivision amount ;) Also, if you set its origin to its centre, it rotates around the centre in 3D too!
Note that, with Spline, I intentionally only use the word vertex to refer to the control vertices of the Spline and never the actual rendered vertices (that only occurs in the implementation code).Yes, I wasn't as deliberate. My path class was the only one referencing the functions.
I see you have quite a few libraries in your engine!Yes... Is that bad? Only a couple graphical helpers, but the rest are scripting/physics/serialization.
you may want to consider Kairos, the timing library, especially since you seem interested in "bending time" ;DI had no idea that existed, lol. It looks pretty cool. Probably doing time management better than we are currently.
If a library already provides what you need, using it makes sense.If a library already provides what you need, using it makes sense.I see you have quite a few libraries in your engine!Yes... Is that bad? Only a couple graphical helpers, but the rest are scripting/physics/serialization.
More information is available from the interpolated positions:This is awesome. I can come up with quite a number of uses for the tangent vector here.
- the tangent (unit vector),
- the normal (the tangent rotated 90 degrees anti-clockwise),
- the interpolated vertex thickness,
- the thickness correction scale (highest at sharper corners and one for straight sections).
If a library already provides what you need, using it makes sense.Yes, we saw no point in reinventing the wheel.
Thank you for your kind words. It's always a good feeling when you hear that someone is enjoying Selba Ward.
I'm not sure I understand your move from C++ to C but I won't judge (too much) ;D
Selba Ward is built so that each drawable object can be used separately from any of the others. So, to use just Console Screen, you can simply copy the files into your project and link them. The (3) files you need would be ConsoleScreen.hpp, ConsoleScreen.cpp and Common.hpp. You could, if you wish, also include PaletteEnums.hpp if you wish to use those but this is not required. Then, just compile along with the rest of your project.
It's worth noting, though, that the files themselves are written in C++ so would need converting to plain C first. Or you could build just those files as a library and use that. Never needed to do this though so it may or may not work or even be possible.
Hope it works out for you!
while (window.isOpen())
{
window.clear();
sf::RenderTexture pre;
pre.create(resolutionX, resolutionY);
//Write lots of stuff to pre
pre.display();
sw::ElasticSprite esprite(pre.getTexture());
window.draw(esprite);
window.display();
}
while (window.isOpen())
{
window.clear();
sf::RenderTexture pre;
pre.create(resolutionX, resolutionY);
//Write lots of stuff to pre
pre.display();
sf::Sprite sprite(pre.getTexture());
window.draw(sprite);
window.display();
}
You need to treat your render texture like a window - that is, create it only once, then call renderTexture.clear() before you draw on it, followed by renderTexture.display() when you've finished drawing.
My guess is that this is, as binary1248 put it, a "feature and not a bug".
See the explanation of RT with Shaders on this GitHub issue () and the related forum post ().
Not sure if Selba Ward could be adjusted to account for RT usage.