Giter Club home page Giter Club logo

Comments (3)

rikai avatar rikai commented on July 18, 2024

In addition to text borders, it'd also be nice to be able to define the text border width.

Other suggestions for improving the text component:
Give a "center" option, that keeps the text centered in the screen (based on the canvas size)

from audio-visualizer-python.

dv-anomaly avatar dv-anomaly commented on July 18, 2024

The text component should also re-calculate it's position on a canvas size change. We had discussed before about storing the position as a float and always calculate the pixel positions based on simple math at render time.

xPosition = x / width     |    x = width * xPosition
yPosition = y / height    |    y = height * yPosition

If current Canvas size is 1280x720, and text position is 640x374:

0.5 = 640 / 1280
0.519444444 = 374 / 720

If resolution chagned to 1920x1080:

960 = 1920 * 0.5
560.99999952 = 1080 * 0.519444444

And round to the closest whole pixel:
x = 960 y = 561 <- equivalent positions for 1920x1080

from audio-visualizer-python.

tassaron avatar tassaron commented on July 18, 2024

Relative coords and center button: 5784cdb
Outline/stroke options and font style: 998f741
Dropshadow option: 060a7dc

from audio-visualizer-python.

Related Issues (20)

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.