Quantcast
Channel: Bugs Latest Topics
Viewing all articles
Browse latest Browse all 760

DynamicTexture options is really confused

$
0
0

IMO it is really confused. Options cannot make up its mind what it wants to be; being kind to the designers:

  • A _canvas
  • An object descriptor: i.e. { width: x, height: y }
  • A size: i.e. { width: options, height: options }

Why do I say this?

I suggest making up its mind: be a descriptor:

if (options.canvas !== undefined) {
    //...
}

Or:

if (!(options.width === undefined || options.height === undefined)) {
    // ...
}
else if (options.size !== undefined) {
   // ...
}

This will cause some breaking changes, but I think it is acceptable to correct the course onto a path of sanity.

Next, I want to add text alignment

if (options.textAlign !== undefined && typeof options.textAlign === "string") {
   // ...
}

I'm glad to submit the PR. I just don't want for it to sit on the shelf when I do.

I would submit a Github issue, but it seems that has been disabled, or is unavailable to BabylonJS.

Is that agreeable?


Viewing all articles
Browse latest Browse all 760

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>