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

Author Topic: Selba Ward  (Read 146100 times)

0 Members and 4 Guests are viewing this topic.

Hapax

  • Hero Member
  • *****
  • Posts: 3379
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: Selba Ward
« Reply #135 on: November 14, 2021, 03:01:38 am »
Update!

Elastic Sprite (wiki)
v1.3
Added ability to assign a flip to the texture.

Horizontal and/or vertical flips can now be assigned to the texture in Elastic Sprite. This allows the ability to assign the texture rectangle as normal but still use it flipped. This works with both interpolation shaders as well as without the shader.

If es is the Elastic Sprite, to assign the flip you can do both or either of:
es.setTextureFlipX(true);
es.setTextureFlipY(true);
You can also 'unflip' by setting them to false.
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

Hapax

  • Hero Member
  • *****
  • Posts: 3379
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: Selba Ward
« Reply #136 on: June 20, 2023, 06:50:35 pm »
Latest!

It has been a while since I've updated this post so I thought it time to bring everyone up to speed with the current state of Selba Ward!

Here, I will be listing the main updates that I've not previously mentioned.

First, though, it should be mentioned that Selba Ward now has a branch that can be used with the currently work-in-progress version 3 of SFML.
You can visit that branch here:
https://github.com/Hapaxia/SelbaWard/tree/sfml3
Note that the documentation is still for the current version of SFML (v2) and will stay that way until the official release of SFML 3. However, very little has changed with the way it can be used anyway; most of the (current) changes are just so that it can communicate with SFML 3 without errors.

Now, back to the main (master) branch and SFML 2...

Generally, all drawables have had any use of the quad primitive removed in advance of the upcoming depreciation of it within SFML. This allows it to be more 'future-proof' for later 2.x versions of SFML as well as bridging a gap to the upcoming v3.

The old version of Console Screen has been removed. The newest version is better anyway ;)



New Additions!

Starfield 3D (wiki)
v1.0.1
A 3D starfield of randomly generated stars.

I'm sure you must have all seen Starfield by now. You may also have noticed its limitations due to its simplicity. It's still, of course, available and can be useful for a simple way to draw pixel stars. The pixel limitation was the reason I decided to make something a bit better; if a screen is high-resolution, pixels are smaller and therefore the stars become less noticable and may require drawing to a render texture first before then enlarging them to be able to see them.

Now, Starfield 3D alleviates this issue by allowing you to draw and actual star shape for every star instead of just a single pixel! In fact, this star shape can be anything at all; you can customise it fully (shape and colour)! Starfield 3D then scales and colours the stars based on depth but the scales and colours can be customised too.
Not just that, but the actual starfield itself is now projected with perspective and is now 'actually' 3D. This allows full control over camera movement to allow fully-3D motion including forwards and backwards (into and out of the scene).

Here is a short animation showing the style of effect:

Note that this GIF animation is looped so there is a noticeable jump when the animation restarts. This does not occur in the actual code.

These are the default star shapes but, as mentioned previously, they can be any shape at all - any collection of triangles (positions and colours!). You can simply pass a vertex array to Starfield 3D and it will copy it as a star template. Remember, of course, that it will be drawn with a primitive type of sf::PrimitiveType::Triangles so the vertex array should probably match that if you want predictable results. Note also that stars cannot be textured.

Polygon
v1.1
Creates a filled polygon from any given number of vertices/points.

Yup! Any convex/concave shape!
It automatically triangulates any 'solid' shape although you should note that overlapping edges are not allowed. It's not perfect and can break and very very complicated shapes but it does the job fine for most normal shapes and I plan to improve it over time.



There is no documentation for this right now but, of course, there will be. Plus, it should be pretty self-explanatory. You may notice there are some methods customise the way that triangulation is performed but there are no extra options at the moment; these will be used when those are added.

Pixel Display (wiki)
v1.0.1
A resizable grid or squares that be coloured individually.

Its intention is to simplify emulating more retro-style displays but can be used for any mosaic-style art.
It stores a palette of colours and then you can reference them by palette index instead of colour. This means if the palette changes, the display also changes and uses the new palette colours. This also allows (built-in) colour-cycling (as shown in the following animation).
You could think of it as a tilemap for colours instead of textures. It also has built-in 'commands' to manipulate it as if it were a pixel display.

It was used to create this animation:




Updates!
Now for some updates to already existing drawables:

Spline (wiki)
v1.6.2
A few additions and fixes:
  • In standard usage, corners no longer overlap so transparency can be used.
  • A Spline can be added to the end (or beginning) or a Spline.
  • A Spline can be 'connected' to another Spline. This can move the entire Spline or just the single vertex required. The Spline can also be automatically rotated so that the two joining vertices match orientation.
  • Both of the above methods can be done as one act - adding a Spline to the end of the Spline while also moving and/or rotating to match.

General
Patch updates
All or most of the drawables have had patch updates to fix various issues including:
  • Removing the use of the quad primitive in advance of it becoming deprecated.
  • Fixing compiler errors.
  • Code consistency.
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: Selba Ward
« Reply #137 on: June 20, 2023, 07:13:02 pm »
Awesome! :)

Need to play around a bit more with all these goodies ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Thrasher

  • SFML Team
  • Jr. Member
  • *****
  • Posts: 57
    • View Profile
Re: Selba Ward
« Reply #138 on: June 20, 2023, 10:18:39 pm »
So cool to see people building on top of v3!

Hapax

  • Hero Member
  • *****
  • Posts: 3379
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: Selba Ward
« Reply #139 on: June 26, 2023, 07:09:02 pm »
Thanks and I hope you enjoy them :)
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

Hapax

  • Hero Member
  • *****
  • Posts: 3379
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: Selba Ward
« Reply #140 on: June 26, 2023, 07:12:43 pm »
Update!

Polygon (wiki)
v1.2
Polygon can now create a polygon...with holes!

Now also has documentation! See its wiki page for a couple of simple examples including one that produces this image:
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

PrinceDabus

  • Newbie
  • *
  • Posts: 1
    • View Profile
    • Email
Re: Selba Ward
« Reply #141 on: November 04, 2023, 09:56:47 pm »
Hey! I was building an app using the ConsoleScreen, and I've noticed that it fails to set the background whenever I pass a background color to it.

I've called cs.crash() and streamed the default color green change directly to the console?
« Last Edit: November 04, 2023, 10:13:41 pm by PrinceDabus »

Hapax

  • Hero Member
  • *****
  • Posts: 3379
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: Selba Ward
« Reply #142 on: November 07, 2023, 11:48:42 am »
Hi!

I'm glad you're finding use of Selba Ward!

However, I'm sorry to hear that you're having some issue with the use of Console Screen.

Could you please provide some small code that reproduces this issue that I can test as I've not yet come across an issue where the background colour has failed to set when required?

Thank you very much! I'd like to find this issue as soon as possible so there can be a fix :)
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*