Giter VIP home page Giter VIP logo

vuengine-core's People

Contributors

jorgeche avatar kr155e avatar snake230 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

vuengine-core's Issues

Dither-based transparency effect

I am proposing a function to set a transparency level for Entities using direct draw to BGMaps.

Depending on a given transparency level, e.g. 75 (percent), a dither pattern is chosen from a predefined set of 8x8 pixel patterns. Then, it is "applied" to all chars in the sprite. That means that all the black pixels (palette index 0) from the dither pattern tile are set to black in the sprite tile as well.

I designed the patterns in an additive way, so that all pixels that are black in one pattern are also black in all the following patterns. Therefore, going through the whole set of dither patterns one after the other, we can also create a fading effect for an individual object without the need to reload the original sprites in between steps.

553582145-Transparency

Transparency

Implement variable size printing

Implement support for variable size printing for more beautiful text. And to fit more of it on the screen, as well. This could potentially be done using an object for each character or through direct printing pixels on the printing bgmap.

An approach using OBJs has been implemented in the past but was removed shortly after.

VUEngine Studio's font editor already supports defining variable widths, although the feature is currently commented out.

An updated FontSpec supporting the feature could look like the following. Mind the new "mode", "variable height" and "variable width" values.

`FontROMSpec ExampleFont =
{
// font charset spec pointer
(CharSetSpec*)&ExampleFontCharSet,

// mode (__FONT_BGMAP, __FONT_OBJECT)
__FONT_OBJECT,

// character number at which the font starts, allows you to skip the control characters for example
13,

// number of characters in this font
26,

// number of characters per line in charset
16,

// size of a single character (in chars) ({width, height})
{1, 1},

// variable size height (in pixels)
6,

// variable size width (in pixels)
{6, 6, 6, 6, 6, 6, 7, 5, 6, 6, 5, 6, ...},

// font's name
"Example",

};`

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.