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

Author Topic: Selba Ward  (Read 147097 times)

0 Members and 2 Guests are viewing this topic.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
AW: Selba Ward
« Reply #90 on: November 06, 2016, 01:49:30 pm »
Nice! Hope I get to play around with it later on this evening. :)

Btw. have you considered providing a CMake file to build it as library?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Hapax

  • Hero Member
  • *****
  • Posts: 3379
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: Selba Ward
« Reply #91 on: November 06, 2016, 04:54:41 pm »
I have considered providing a CMake file to build it as library, yes, but I am yet to have a successful experience with CMake.

I hope you enjoy it. I think Selba Ward is really useful; maybe I'm biased but I do actually use it all the time ;D
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: Selba Ward
« Reply #92 on: November 06, 2016, 11:10:22 pm »
Too bad, I still can't compile Console Screen.

Now it complains that the types of the enums are not the same, so I think you'll need to add : int to the definition of the enums as well.

Next this line doesn't seem to compile, because you don't provide a value for CellAttributes and the constructor of CellAttributes is defined explicit, so it must be called.

void ConsoleScreen::crash()
{
        for (auto& cell : m_cells)
        {
                cell = { randomByte(), ColorPair(priv_getRandomColor(), priv_getRandomColor()) };
        }
So changing to:
cell = { randomByte(), ColorPair(priv_getRandomColor(), priv_getRandomColor()), StretchType(), CellAttributes() };
seems to work.

But the compilation spits out quite a few errors:
src\ConsoleScreen.cpp||In member function 'selbaward::ConsoleScreen& selbaward::ConsoleScreen::operator<<(const selbaward::ConsoleScreen::CursorCommand&)':|
src\ConsoleScreen.cpp|494|warning: narrowing conversion of '(((selbaward::ConsoleScreen*)this)->selbaward::ConsoleScreen::m_cells.std::vector<_Tp, _Alloc>::size<selbaward::ConsoleScreen::Cell, std::allocator<selbaward::ConsoleScreen::Cell> >() - 1ull)' from 'std::vector<selbaward::ConsoleScreen::Cell>::size_type {aka long long unsigned int}' to 'unsigned int' inside { } [-Wnarrowing]|
src\ConsoleScreen.hpp||In constructor 'selbaward::ConsoleScreen::ConsoleScreen(sf::Vector2u)':|
src\ConsoleScreen.hpp|479|warning: 'selbaward::ConsoleScreen::m_buffers' will be initialized after [-Wreorder]|
src\ConsoleScreen.hpp|455|warning:   'selbaward::ConsoleScreen::ActionFlags selbaward::ConsoleScreen::m_do' [-Wreorder]|
src\ConsoleScreen.cpp|632|warning:   when initialized here [-Wreorder]|
src\ConsoleScreen.hpp|508|warning: 'selbaward::ConsoleScreen::m_numberOfTilesPerRow' will be initialized after [-Wreorder]|
src\ConsoleScreen.hpp|491|warning:   'std::vector<sf::Color> selbaward::ConsoleScreen::m_palette' [-Wreorder]|
src\ConsoleScreen.cpp|632|warning:   when initialized here [-Wreorder]|
src\ConsoleScreen.hpp|491|warning: 'selbaward::ConsoleScreen::m_palette' will be initialized after [-Wreorder]|
src\ConsoleScreen.hpp|482|warning:   'selbaward::ConsoleScreen::CursorProperties selbaward::ConsoleScreen::m_cursor' [-Wreorder]|
src\ConsoleScreen.cpp|632|warning:   when initialized here [-Wreorder]|
src\ConsoleScreen.hpp|494|warning: 'selbaward::ConsoleScreen::m_characterMap' will be initialized after [-Wreorder]|
src\ConsoleScreen.hpp|462|warning:   'const selbaward::ConsoleScreen::PrintProperties selbaward::ConsoleScreen::m_defaultPrintProperties' [-Wreorder]|
src\ConsoleScreen.cpp|632|warning:   when initialized here [-Wreorder]|
src\ConsoleScreen.cpp||In member function 'void selbaward::ConsoleScreen::scrollRight(unsigned int)':|
src\ConsoleScreen.cpp|1651|warning: narrowing conversion of '((((selbaward::ConsoleScreen*)this)->selbaward::ConsoleScreen::m_cells.std::vector<_Tp, _Alloc>::size<selbaward::ConsoleScreen::Cell, std::allocator<selbaward::ConsoleScreen::Cell> >() - ((std::vector<selbaward::ConsoleScreen::Cell>::size_type)i)) - 1ull)' from 'std::vector<selbaward::ConsoleScreen::Cell>::size_type {aka long long unsigned int}' to 'unsigned int' inside { } [-Wnarrowing]|
src\ConsoleScreen.cpp||In member function 'unsigned int selbaward::ConsoleScreen::addBuffer(sf::Vector2u)':|
src\ConsoleScreen.cpp|2235|warning: narrowing conversion of '((selbaward::ConsoleScreen*)this)->selbaward::ConsoleScreen::m_buffers.std::vector<_Tp, _Alloc>::size<selbaward::ConsoleScreen::Buffer, std::allocator<selbaward::ConsoleScreen::Buffer> >()' from 'std::vector<selbaward::ConsoleScreen::Buffer>::size_type {aka long long unsigned int}' to 'unsigned int' inside { } [-Wnarrowing]|
src\ConsoleScreen.cpp||In member function 'void selbaward::ConsoleScreen::resizeBuffer(unsigned int, sf::Vector2u)':|
src\ConsoleScreen.cpp|2261|warning: narrowing conversion of '(buffer.selbaward::ConsoleScreen::Buffer::cells.std::vector<_Tp, _Alloc>::size<selbaward::ConsoleScreen::Cell, std::allocator<selbaward::ConsoleScreen::Cell> >() / ((std::vector<selbaward::ConsoleScreen::Cell>::size_type)buffer.selbaward::ConsoleScreen::Buffer::width))' from 'std::vector<selbaward::ConsoleScreen::Cell>::size_type {aka long long unsigned int}' to 'unsigned int' inside { } [-Wnarrowing]|
src\ConsoleScreen.cpp||In member function 'int selbaward::ConsoleScreen::priv_getIndexOfClosestPaletteColor(const sf::Color&) const':|
src\ConsoleScreen.cpp|3080|warning: narrowing conversion of '((const selbaward::ConsoleScreen*)this)->selbaward::ConsoleScreen::m_palette.std::vector<_Tp, _Alloc>::size<sf::Color, std::allocator<sf::Color> >()' from 'std::vector<sf::Color>::size_type {aka long long unsigned int}' to 'unsigned int' inside { } [-Wnarrowing]|
src\ConsoleScreen.cpp|152|warning: 'void {anonymous}::addPalette2ColorWhiteBlack(std::vector<sf::Color>&)' defined but not used [-Wunused-function]|
src\ConsoleScreen.cpp|146|warning: 'void {anonymous}::addPalette2ColorBlackWhite(std::vector<sf::Color>&)' defined but not used [-Wunused-function]|
 

Maybe you could try and raise the warning level in VS and try to fix all the warnings?

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. ;)

Edit
Since the little example uses the PaletteEnum header, I also included it and well I get a bunch of errors, because you apparently can't make an enum const.
PaletteEnums.hpp|45|error: 'const' can only be specified for objects and functions|

Edit2
You might want to enforce a standard so you can detect these non-standard behavior: https://blogs.msdn.microsoft.com/vcblog/2016/06/07/standards-version-switches-in-the-compiler/

Edit3
Do you know why some elements don't load or load wrong when using only a few tiles?

vs
« Last Edit: November 07, 2016, 10:15:29 pm by eXpl0it3r »
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Hapax

  • Hero Member
  • *****
  • Posts: 3379
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: Selba Ward
« Reply #93 on: November 08, 2016, 03:25:55 am »
Thanks for the feedback. I really appreciate it!

I have added the storage types to the definition of the enums as well. Hopefully, you'll have more luck with that :)

The default constructor of CellAttributes was declared as explicit, which, it seems, should be ignored. Still, I've removed the explicit keyword from all default constructors as they don't really serve a purpose. Not providing a default value in the initialisation list should call its default constructor, right? If not, I can add constructors to Cell to allow it.

The warning level in VS has been set to its default setting: /W3, which includes warnings that are "severe", "significant" and "production quality". I've taken the level up to /W4 now, which includes "informational" warnings. I've also tried /Wall and that gives me lots of warnings. Most, however, are in "cmath" and SFML.

Still, even using /W4, I get no warnings about forward-declaring enums, const enums or explicit default constructors. Still, I've fixed those now so feel free to give it another try...

I'm not even sure why you get a warning about the order in which members will be initialised. Can you see why?

Even though I'm aiming for C++11, I've used the C++14 standards switch and it still throws out no warning about forward declaring enums... Or, indeed, anything else at its current state (there may be some warnings in "Console Screen Old" as I'm not fixing those :P )

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.
You could print without using begin and end to use the cursor or you could hide the cursor (cs.setShowCursor(false);)
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
AW: Re: Selba Ward
« Reply #94 on: November 08, 2016, 04:02:09 pm »
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.
You could print without using begin and end to use the cursor or you could hide the cursor (cs.setShowCursor(false);)
Ah, I didn't know that there was a cursor! That must be it. :)

Will try the updated version later on.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: Selba Ward
« Reply #95 on: November 08, 2016, 08:36:10 pm »
Seems to work fine now, but still getting warnings. ;)
(click to show/hide)

Also, how do I change the mode of the CS while keeping it's content?

Edit
Could the backspace command be checked to only go back where stuff was actually printed?
Like if you print a newline and then use backspace, it will start at the line end, instead of where you inserted the new line.

Edit2
Well I got it working, but it's not really as nice as I'd like to be. But here's the result.


« Last Edit: November 09, 2016, 01:25:06 am by eXpl0it3r »
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Hapax

  • Hero Member
  • *****
  • Posts: 3379
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: Selba Ward
« Reply #96 on: November 09, 2016, 02:04:07 am »
Glad you got it to work. Hope you'll enjoy it! :)

Although changing the mode does clear the screen and reset the palette (as actual console screens would do), it also clears the buffers, which would be able to be copied over after adjusting the mode if they remained. You can, of course, copying all of the cells into your own vector of cells and add them back after changing the mode but this would be 'fiddly'. They were cleared because buffers were originally full-screen only so would be out of range with different modes but now that's relaxed due to having ability of having different sized buffers and off-screen pasting is just ignored, the buffers could be kept during a mode change. I'll change that so that buffers remain; you will then be able to copy the screen, change the mode and then paste the buffer onto the new mode.

That said, now there is the ability to use buffers in that way, changing the mode wouldn't actually need to clear the screen; it could automatically do the copying and pasting. However, I'm not sure about that. I would expect changing a screen's mode to clear it plus copying and pasting onto the new mode would be a waste if the screen then needs to be cleared.
What use requires the content to be still available after a change of mode? I've just noticed your "resize" gif that shows the content stretching to match the screen.
I don't know how you did it :P You could be changing the mode and copying across the cells/re-printing after a size change or changing how many columns to use depending on the window size (where part of the Console Screen would be "off-window")?

One thing to note is that Console Screen is mainly just a screen, not a text/content editor so keeps no track of where a line of text ends, for example. The text-editor-style manipulation is provided mainly to move around the cursor. The "new-line" command doesn't add a new-line character to the screen; it simply moves the cursor.
Extra cursor commands can to added so there could be one that repeats backspace until it reaches a specified cell value but this isn't identical to the functionality that you wanted and I'm not sure it makes a decent addition, especially since it's simple enough to do manually.

Also, it's worth noting that a cleared/deleted cell has a cell value of zero. Depending on your texture setup and character mapping, zero might actually be a character (it doesn't have to be ASCII ordering). This means it's not as simple as just if something was printed there as it completely depends on which values you consider as being printed.

It's nice that it's working well with SFGUI too :)

I don't see any warnings to worry about ;) I still don't know why it's warning that numberOfTilesPerRow will be initialised after m_palette...

You may be interested in this quick basics tutorial ;)

Edit
Patched Console Screen to v2.3.1. Buffers now persist over mode changes so you can do something like this to keep content:
cs.copy();
cs.setMode(newSize);
cs.paste();
cs.removeBuffer();
Note that it doesn't wrap content as in your animation; it merely pastes the content on top of the new mode. If the new mode is larger, the extra cells will be empty. If the new mode is smaller, the previous cells that do not fit will be discarded (they would still be available in the buffer if you don't remove it).
« Last Edit: November 09, 2016, 03:04:38 pm by Hapax »
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 #97 on: December 20, 2016, 12:06:36 am »
Demo Animation:

(best viewed in 1080 quality and 60 FPS)

Loading Intro
Just Console Screen for this part. The Console Screen is the light blue section. The "screen border" is the colour of the window and is just cleared to a solid colour (the flashing "loading" border is just clearing to a randomly chosen colour from the Console Screen's palette). The content is then "typed" one character at a time. The cursor is shows/hidden based on the current time in the animation (so that it flashes):
cs.setShowCursor(anim.csCursorVisibility.get(currentTime) && (currentTime % sf::seconds(1.5f) < sf::seconds(0.9f)));
anim.csCursorVisibility is an animation track that allows the cursor to be switched on and off depending on the current time in the animation. This line, then, flashes the cursor only when the cursor should be visible.
Actually, the Console Screen is technically drawn onto a render texture and then that texture is drawn to the window using a sprite; we use a Sprite 3D to achieve this.

Cube
The Console screen persists from the loading intro but the palette colours are changed. The Sprite 3D is animated to rotate to look like a cube. There are two Sprite 3Ds here, both using the same texture (from the render texture of the Console Screen) so both (seemingly all) faces of the "cube" are identical. As one face becomes completely obscured by the other, it effectively rotates 180° to continue as the next face. The Sprites are darkened based on their angle away from the "camera" to give some impression of 3D lighting.

There are also 7 Splines that have their vertices and (Bezier) handles animated based sinusoidally (a recurring technique in this animation). The vertices are equally spaced horizontally; only the y position of the vertices and handles are animated.

The Starfield, which is drawn behind everything else, is constantly moved left to give the impression of travelling to the right.

The "flashes" that match the music are only the window's background colour.

When the "yellow flashes" occur, the colour of the Splines transition from yellow/red-based to blue-based while the palette colour of the Console Screen that fills most of the screen changes from blue to red.

The phrase "Check in to check it out" shown on the Console Screen is output to the screen's stack cells. These particular cells are "on top" of the standard cells so are always displayed above them.

The entire screen is scrolled so that the title is at the top, scrolling the URL off the top. Note that stack cells don't scroll.

At the beginning of the animation, a buffer is prepared from a bit pattern for the block logo. This is made up of quarter cell blocks to display a mosaic logo. This is pasted at different positions on the screen so it can scroll onto the screen.

The title is scrolled left (just the top section is scrolled now, not the entire screen), wrapping from one side to the other. This gives the impression that the logo moves from one face to the next.

The "police line" row is flashed by animating the inverse attribute of that row (in a similar way to animating the flashing cursor):
                                cs << Cs::Begin;
                                if (currentTime % sf::seconds(1.2f) < sf::seconds(0.5f))
                                        cs << Cs::CellAttributes(Cs::Affect::Inverse) << Cs::Affect::Inverse;
                                else
                                        cs << Cs::CellAttributes(Cs::Affect::None) << Cs::Affect::Inverse;
                                cs << csFlashLineLocation << Cs::Wipe(textFlashLine.size());
                                cs << Cs::End;

Scroller
The Console Screen (and its Sprite 3D, although only one is used now) persists through this section as well. The palette is manipulated so that the colours that were shown are now all transparent except the title's text.

The Starfield persists too but is now moved in the opposite direction (but slows down toward the end).

The VU meters are three Progress Bars. The one on the left represents the left channel, the one on the right represents the right channel and the central one represents both. This is why the centre bar is always higher than both. The progress bar is "rounded" to one of the blocks so that it doesn't "light up" only half of a single light block.
The meters themselves use the actual music as input and the result is based on the music's current decibel level, not just its peak or even its RMS. To allow simpler access to the music's samples for this, the music is loaded as a sound buffer and played as a sound, rather than opened and streamed using sf::Music.

The scrolling text is a single Bitmap Text object that is just moved to scroll. The Bitmap Font used is customised to allow features like hanging letters (e.g. g, j, y) without increasing the entire cell for each character/glyph, different widths (e.g. l, i, j are thinner) and kerning (e.g. capital t followed by lower-case e "Te" are closer together).

Snake
The Starfield is now moved upwards (quite quickly) to the impression of moving downwards (quickly, similar to falling).

The "snake" here is a group of Rings that use the same motion paths. They differ their position on the path but the path used is the same. The path and the positions for each ring are sinusoid-based.

The texture used for the Rings is multi-coloured but not very saturated so that all of the colours still exist. For the first half of the snake section, the rings are coloured (multiplied by a colour) by a rainbow of colours. This gives each Ring a different base colour.

The Rings are drawn in the same order each time. The "back" ones (the ones drawn first) are slighly smaller to give the impression of depth. The "front" Ring has the entire ring segment and each ring behind it has a little less segment. Each ring is also rotated clockwise a little more than the one in front of it to give it a "corkscrew" look, although all rings are also being rotated constantly together as well.

The "hole" of all of the Rings are animated together to match the music in the first half of the snake section.

In the second half of the snake section, however, things are different...

The holes are no longer animated but the scale of the Rings are now animated to follow the beat of the music.

The segments of all of the rings are now animated similarly to the scale to follow the beat of the music. At their largest scale, the segments are as they were in the first half but at their smallest scale, the segments have a further 90° of the ring removed.

The colours of the Rings are now all set to white so that the original "pastel rainbow" texture can be seen on each ring. This gives each ring multiple colours. Note that because of the "corkscrew rotation", the colours also follow that look.

The asteroid that is introduced in this section is drawn using a Gallery Sprite, which just has its y position moved until it "collides" in the next section while it is just rotated.

The "snake" is moved off the top of the screen before the next section.

Rocket
A 2D side-scroller-style map using Tile Map then moves onto the screen quickly until the asteroid collides with it. At which point, the map, the asteroid, the stars, the rocket (a Gallery Sprite) and the rocket stand/astronaut animation (also a Gallery Sprite) all cease motion.

The asteroid's explosion is a Gallery Sprite that plays through its "exhibits" (or animation frames). The asteroid is removed when the explosion is large.

After the explosion has happened, the astronaut animation shows a door opening in a wall and a character jumping from it to the rocket's ladder. The ladder is then closed into the rocket and the door on the wall is closed. This is a frame animation and uses a Gallery Sprite. The frame durations are not equal; Plinth allows each frame of a Frame Animation to have its own duration. This allows delays on a single frame and some animation sections to have differing frame rates - as this animation does.

Following the astronaut's boarding the rocket, the rocket takes off. The rocket is a Gallery Sprite with 4 exhibits: 1 that is just the rocket and 3 of the rocket with propulsion flames that can be cycled for an animated flame. Note that the rocket is clearly drawn behind the Tile Map so that the flames don't appear over the map.

The rocket is then rotated to fly to the right and the Tile Map's camera is moved to the right (along with the stars being moved to the left) so that the level is scrolled to the left.
Note that there is, in fact, two Tile Maps here: the main "grey" one and a secondary, slightly smaller, bluer one behind it. The idea behind that was to create some depth but it ended up not being very noticeable.

The UI of the "side-scroller" is then scrolled into view. The texts are Bitmap Texts (using the same Bitmap Font as the scroller) and Progress Bars. Fuel and Power are simple coloured bars on coloured backgrounds but the Life bar is a texture bar. The texture is the width of a single "heart" image and contains only a full heart and an empty heart below it. The texture is repeated so that multiple heart can be seen by using a texture rectangle that passes the boundaries of the texture.

As the rocket moves up and down, the Tile Map camera is also moved up and down and the stars are moved accordingly.

The rocket's "laser" is just a Line. That is, it is a thick, textured Line. Whenever the laser is fired, "Power" is reduced by a small amount.

The level's "defence guns" are static level tiles and the level data is manipulated when they change to "damaged" (by changing the value of that tile). Similarly, the "barrier" that is shot away is a static level tile that is changed to a blank tile.

Since there is never more than one explosion on the screen at any one time, the same explosion Gallery Sprite is re-used for each explosion.

When the rocket "escapes the confines of the side-scroller to become a top-down scroller, the rocket is scaled up to show that it is now above the map. After leaving the map, however, it "drops" back down (scales down) to begin the vertical shooter-style section. The Starfield is moved downwards for this section.

The enemy ships are all Gallery Sprites. The enemies have animations for each gun firing. The actual enemy shot, though, is a thick, solid colour, Line.

For the "hyperspace" animation, multiple Lines are used. All lines are actually really long and just scrolled onto the screen together. The Starfield is removed too at this point.

Walk
Following the "clear white" of the hyperspace, the white is removed to reveal a walk animation on a coloured background. The character walking is a Gallery Sprite cycling through an 8-exhibit animation (in time with the music). The animation is "zoomed in" quite extremely and then zoomed back out to reveal lots of similar walking animations.

The "spiky" animation in the centre here is a Pie Chart. Each slice is "exploded" (pushed out from the centre) by a different amount based on - you guessed it - a sinusoid.

The floor here is made up of two separate things: a Ring and a Line.
The thick Line is the straight floor and the Ring segment is the curved part of the floor. As the floor moves, the Ring segment increases and the Line is reduced. The texture rectangle are adjusted to match their positions.

The characters walk along the straight floor and then up the curved (actually circular) floor. The floor moves to be a full Ring. At this point, the Line is no longer used.

Next, the Pie Chart's explosions are stopped as the characters have their heights scaled in a sinusoidal pattern. This scaling is to how the characters are clearly anchored to the floor. Technically, the "origin" of the Gallery Sprite is still at (0, 0). This is because each exhibit can have its own anchor point, which, in this case, is where the floor would be.

After some rotations of everything, the Pie Chart explosions return and the characters' heights are restored to normal just before "rolling" the entire thing off the screen.

Credits
The credits section uses the Nine Patch to display a strechable rectangle. Note that the corners are always the same size; it's the rest of the image that is stretched.

The Console Screen returns for this section. Its size and position is determined by the rectangle returned by the Nine Patch's "content area".

The screenshots gallery shown on the right use a Gallery Sprite. All of the screenshots are contained on one texture and the Gallery Sprite moves through those exhibits. It fades in and out and scales in and out for each screenshot.

The shadow on the Console Screen is created by copying the screen into a buffer, changing all of the colours in the buffer to be "shadow black" (black with some transparency) for the foreground and completely transparent for the background. The buffer is then pasted onto the stack (the "under" stack) so that it is shown below all of the standard cells. Stack cells can also have their position offsets so that allows the shadow's offset.
Note that this animation does not do this effect particularly efficiently. These shadows are created on every frame; that is, the entire screen is copied, manipulated, pasted and the buffer and all of the stack are both removed constantly. It would have been better to have done this only when the screen actually changes or, better still, use either a texture that contains the shadow or use a shader. However, this was done to make use of the "under stack" and its ability to be shown under the standard cells as well as having positional offsets (which is why the bespoke texture and shader techniques weren't used).

Console Screen's crash method was used for the crash screens. During those "crashes", the Nine Patch is faded out.

The final display on the Console Screen is the block/mosaic logo that was used earlier on the "cube" section. This time, however, the shadow is still being created so the logo has a bit more detail.



Finally

In this post, I have attempted to explain which Selba Ward object was used for which task and how it was used to achieve that particular effect. There was not much actual code shown here as most of the things done are controlled by Plinth's animation tracks and the actual main code is not organised well. However, there should be the information you need to understand what it going on and if you use the objects, you should be able to perform these tasks.

If there is anything you would like me explain in more detail, something you don't understand or just any questions about Selba Ward or the demo animation or its resources, feel free ask on this thread.

For more information, you can read the Selba Ward wiki.
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

Mortal

  • Sr. Member
  • ****
  • Posts: 284
    • View Profile
Re: Selba Ward
« Reply #98 on: December 20, 2016, 01:32:10 am »
that's incredible amazing, i thought i were know what  Selba Ward could do based on my earlier work out, but after watching the demo it changes my respective completely.

Hapax

  • Hero Member
  • *****
  • Posts: 3379
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: Selba Ward
« Reply #99 on: December 20, 2016, 03:23:34 pm »
Thanks, Mortal! :)
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 #100 on: March 05, 2017, 02:32:12 am »
Updates!

Spline (wiki)
v1.1
Added ability to draw a thick spline instead of an infinitely thin (and therefore drawn as a single pixel-width) spline.

Specifying a thickness of zero uses the infinitely thin spline (uses sf::LineStrip) whereas any other thickness amount is used to generate a thick spline. "Line joints" are calculated to keep consistent thickness.

Thickness works with both linear splines (angled line segments) and Bezier splines (interpolated curves).

Replaced deprecated SFML enum value (sf::LinesStrip) with valid value (sf::LineStrip).

Plus, a few fixes.

Console Screen (wiki) (change log)
v2.3.2
More double-height functionality: cursor commands and wrapping while printing moves two rows at a time and automatic scrolling move two rows if set to "both". Cursor becomes double height when cursor's print properties is set to "both".

Stack cells can now be positioned "off-grid". Since they are individual cells that float above (or below) the main cell grid, they can be independantly positioned.

Buffers are no longer removed when mode is changed as they are not required to match the mode exactly.
However, stack is now removed when mode is changed.

Numerous fixes since v2.2.0.

v2.4 coming soon... (it's already started but want to try to have more things in the update)

Nine Patch (wiki)
v1.3
You can now set (and get) its colour - the colour of all of its vertices. The default usage of this colour is to "multiply" it with the texture (as with standard SFML drawables).

Gallery Sprite (wiki)
v1.1
Texture rectangles now use floats instead of ints allowing "smoother" choices.

Plus, minor fixes.

Line (wiki)
v1.2
Thick line now uses a manually calculated vertex array rather than an sf::RectangleShape.

Bounds now take into account thickness.

Thickness amount fixed (was thickness on both side - 10 thickness resulted in a line 20 thick - but is now correct).

Texture rectangle uses floats instead of ints to allow "smoother" choices.
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 #101 on: March 14, 2017, 03:55:55 pm »
Added a couple of simple examples to Spline's wiki page to show how thick splines look.

Both use a spline of only three vertices.

Simple example 3 (thick):


Simple example 4 (thick curve):
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 #102 on: March 18, 2017, 02:13:41 pm »
A new drawable, Elastic Sprite, is currently a work-in-progress.

Feel free to try this testing application (Windows only):
http://www.mediafire.com/file/sdw0acme64lgvo9/testSelbaWardElasticSprite.exe



It's statically built so you only need the single executable file.
However, as always, if you don't already have it, you may need the Microsoft Visual C++ 2015 Redistributable:
https://www.microsoft.com/en-us/download/details.aspx?id=53587
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Selba Ward
« Reply #103 on: March 19, 2017, 12:32:39 am »
Nice! :)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Hapax

  • Hero Member
  • *****
  • Posts: 3379
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: Selba Ward
« Reply #104 on: April 01, 2017, 12:48:35 pm »
New Drawable! (finally)
Elastic Sprite
(wiki)
A sprite class that can have its vertices (corners) manipulated individually: position offsets and/or their colours.

Screenshots of the simple examples, available on its Wiki:
Simple example - texture:


Simple example - colour:


Simple example - texture and colour:
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

 

anything