Very basic questions

Coming off a work project that was vision based. Working on a home hobby project that is using maker edition. I am struck by how unfamiliar / out of sorts I feel. With basic display components.

Label (for static text). Took me forever to figure out how to horizontally center align.
Is this the best practice? Without diving into styles etc...

I finally noticed this modify style. And selected textAlign center.
image

No basic numeric display component. So suppose I can use a label or the LED styled component.
The label, with text bound to a float tag value, seems to ignore the tag's string format. So do an expression....


That works fine but seems convoluted verses just having the label component have a property that is FormatString or numberFormat.

The LED display, while it has a numberFormat property it seems to want to be horizontally right aligned no matter what.

Wanted to make sure I was not missing something before I build this out more.

Perspective is so totally different from Vision that it is not an unusual remark.

For one, you should get used to using styles. Perspective is fundamentally a web page, and styles dominate the runtime environment.

Also, get used to not placing objects with precision. Yes, there's a coordinate container, but you should avoid it for anything other than piping and hosting diagrams. Instead, give components consistent sizing and let them flow in flex containers. Perspective is meant to be used with a variety of device resolutions, where pixel perfection works against you.

You tagged this post "vision", but Maker is Perspective only.

2 Likes

Label (for static text) ... center align.
Is this the best practice? Without diving into styles etc...

Dive into styles!

I finally noticed this modify style. And selected textAlign center.

Even better, define a style under Perspective | Styles and you can call it "AlignCenter". You define the style the same way you did in the label.
Now anywhere you need center-aligned you just select that style from the label's style.classes dropdown. Do the same for any style that you are going use more than once.

No basic numeric display component. So suppose I can use a label or the LED styled component.

Use the label. The LED display was great in the 1970s.

The label, with text bound to a float tag value, seems to ignore the tag's string format.

It's not applied automatically. You can apply it as follows:

numberFormat(
   {[default]MyTag}, 
   {[default]MyTag.FormatString}
)
// Can be all on one line. Split for ease of reading.

The LED display, ... seems to want to be horizontally right aligned no matter what.

As a numeric display should be! At least it has one redeeming feature!

1 Like