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

Author Topic: Selba Ward  (Read 34017 times)

0 Members and 1 Guest are viewing this topic.

salianifo

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Selba Ward
« Reply #120 on: May 21, 2017, 10:57:54 pm »
Are you planning on adding a feature to the Nine Patch to allow multiple stretching sections? Something along the lines of what this post on StackOverflow is trying to achieve?

Hapax

  • Hero Member
  • *****
  • Posts: 2776
  • My number of posts is shown in hexadecimal.
    • View Profile
Re: Selba Ward
« Reply #121 on: May 22, 2017, 02:40:32 pm »
There are currently no plans to expand Nine Patch to have more than nine patches although it can be a consideration for the future.

Note that it can be achieved by displaying Nine Patches together.
Selba Ward - SFML drawables
Kairos - Timing Library
Rectangular Boundary Collision - Rectangular SAT Collision

@Hapaxiation - Hapaxia on Twitter

Hapax

  • Hero Member
  • *****
  • Posts: 2776
  • My number of posts is shown in hexadecimal.
    • View Profile
Re: Selba Ward
« Reply #122 on: August 07, 2017, 05:17:52 pm »
Update!

Elastic Sprite (wiki)
v1.1
Added ability to use perspective interpolation instead of bi-linear interpolation.

Bi-linear interpolation can look 'rubbery' but remains evenly distributed and edges match easily. Note that lines can be bent (notice the red diagonal squares 0-9 in the examples below); then again, it is technically a similar method to calculating bezier curves...
Perspective interpolation adjusts the apparent 3D rotation of the quad to match the vertices' positions. This is similar to Photoshop's free transform's individual corner manipulation. Note that distribution is no longer even and edges will not match so easily.

Compare below.

Bi-linear:


Perspective:



One additional thing to note is that the RGB components of the sprite's colour are disabled when drawn using perspective interpolation; the alpha is used as normal.
The reason for this is because an extra "weight" float per vertex that would be interpolated like other vertex attributes is needed. Since SFML's vertex format is rigid and only has 2d position and texture co-ordinates, this value could not be passed through a spare. This led to the decision to encode the float into the three colour (RGB) components of the sprite's colour.
Selba Ward - SFML drawables
Kairos - Timing Library
Rectangular Boundary Collision - Rectangular SAT Collision

@Hapaxiation - Hapaxia on Twitter

Hapax

  • Hero Member
  • *****
  • Posts: 2776
  • My number of posts is shown in hexadecimal.
    • View Profile
Re: Selba Ward
« Reply #123 on: June 05, 2019, 02:51:57 am »
Updates!
(summary since previous post)

Console Screen (wiki)
v2.4.1
- Can stream numbers using the new Number type.
- Can now get cell location of a given co-ordinate
- Can get (transformed) co-ordinate of a cell location.
- New 8-bit RGB palette
- Can now set the cell value used for 'clearing' a cell; it is no longer required to be zero.
- Can now customise the multiplier used for darkening a cell's colour when using Dark attribute (Bright has been swapped for Dark).
(more info.)

Tile Map (wiki)
v2.0.1
- Now fully templated.
- Connect the level when needed rather than having to pass it with every update.
- Level width is now also stored and can be changed separately.

Elastic Sprite (wiki)
v1.2
- Fixed perspective interpolation when used with larger texture or offset
- Perspective interpolation can now be used with colours

Spline (wiki)
v1.5
Multiple corner types
These are applied at every point (except start and end points) including interpolated ones.
They allow corners to take a form that is different from the original 'point' corner.

The corner types available are:
Point
The original type. This extends the edges until they meet. This has no limit.
PointLimit
Similar to Point. This extends the edges until they meet. However, if the length of this point is greater than the maximum allowed length (customisable), this point is 'pulled inwards' until it reaches that length.
PointClip
Also similar to Point. This extends the edges until they meet. However, if the length of this point is greater than the maximum allowed length, this corner is converted into a bevel-style corner (see below).
Bevel
This does not extend the edges until they meet. The two corners of the rectangles - that make up the two joining thick straight lines - are joined together.
Round
This also does not extend the edges until they meet. This is similar to Bevel except the the corners are joined together using a circular curve. The interpolation level of round corners can also be customised; a level of zero is visually equivalent to a bevel corner.

Multiple cap types
Caps are how the start and end of the Spline are drawn.
Each cap (start and end) can be customised separately.
Available cap types:
None
This adds nothing to the spline. It therefore appears as a flat edge that passes across the vertex.
Extended
This extends the flat edge so that it is half of the thickness of the Spline away from the vertex. This leaves half thickness around the vertex.
Round
This adds a semicircle to the flat edge. The centre of the semicircle is the vertex. Its radius is half of the thickness. It reaches the same distance as the Extended type. This leave half thickness around the vertex.
The interpolation level of round corners can be customised; a level of zero is visually equivalent to "None" and a level of one is a "triangle" cap.

Random normal offsets
Each point (including all interpolated points) can be offset along its normal by a random amount. The range of this random distance can be customised. Each vertex also has this range so it is interpolated and multiplied in a similar way to the thickness and vertex thicknesses. The offset, however, is centred on the original Spline path. This allows 'lightning' style effects.

Optimisation
The updates have been optimised, allowing only the visual representation to be updated if the Spline itself hasn't moved or interpolation settings haven't changed. Basically, as long as it doesn't need to calculate the points or interpolation points, just the visual representation can be updated separately.

Note that the corner and cap types only apply to a thick Spline whereas the random normal offsets apply to both a thick and a thin Spline.

Simple Example 3b (thick with rounded corners and caps):


Simple Example 4b (thick with rounded corners and caps):


Simple Example 1b (random normal offsets - lightning):


General
Numerous fixes that include compiler errors or other bugs.
Selba Ward - SFML drawables
Kairos - Timing Library
Rectangular Boundary Collision - Rectangular SAT Collision

@Hapaxiation - Hapaxia on Twitter

 

anything