Numeric Displays

Post Reply
UrbanCyborg
Posts: 599
Joined: Mon Nov 15, 2021 9:23 pm

Numeric Displays

Post by UrbanCyborg »

I was wondering how the numeric displays in things like Andrew Macaulay's Dual Frequency Meter are done. Are they extensions of the Counter type, or done from scratch, maybe with the Canvas Type? Anyone know, or any guesses. I don't see any way to get more than integer digits in the Counter type.
Cyberwerks Heavy Industries -- viewforum.php?f=76
User avatar
seal58
Posts: 354
Joined: Fri Jul 12, 2019 5:28 pm
Location: Rostock, Germany
Contact:

Re: Numeric Displays

Post by seal58 »

For example, in my p.moon CV-Meter I used regular text labels as digital display.
But it's a little bit tricky to get the characters onto right place.
UrbanCyborg
Posts: 599
Joined: Mon Nov 15, 2021 9:23 pm

Re: Numeric Displays

Post by UrbanCyborg »

I thought of that, but figured I'd have the very problem you mentioned.
Cyberwerks Heavy Industries -- viewforum.php?f=76
User avatar
seal58
Posts: 354
Joined: Fri Jul 12, 2019 5:28 pm
Location: Rostock, Germany
Contact:

Re: Numeric Displays

Post by seal58 »

Andrew Macauley seems to use the regular CA Digital Counter. At the moment there are 7 styles for the counter available.
Count of digits is always setable.
Additional characters like "Hz" then can be added by means of a text label with similiar style.
UrbanCyborg
Posts: 599
Joined: Mon Nov 15, 2021 9:23 pm

Re: Numeric Displays

Post by UrbanCyborg »

Monki-bobo's Volt Meter seems to be doing a custom draw.
Cyberwerks Heavy Industries -- viewforum.php?f=76
UrbanCyborg
Posts: 599
Joined: Mon Nov 15, 2021 9:23 pm

Re: Numeric Displays

Post by UrbanCyborg »

I was looking through the sample code, and found that the timer sample does it with a text label.
Cyberwerks Heavy Industries -- viewforum.php?f=76
User avatar
honki-bobo
Posts: 306
Joined: Sat Nov 09, 2019 1:18 pm

Re: Numeric Displays

Post by honki-bobo »

UrbanCyborg wrote: Thu Feb 03, 2022 12:20 pm Monki-bobo's Volt Meter seems to be doing a custom draw.
I'm using a text label that I update on every GUI repaint.

And it's honki-bobo ;)
Image
Monkey Business Audio
Modules - Music - Twitter - YouTube
UrbanCyborg
Posts: 599
Joined: Mon Nov 15, 2021 9:23 pm

Re: Numeric Displays

Post by UrbanCyborg »

Sorry about that, honki-bobo-san. My memory failed me. So, that's just a text label update, eh? I'm guessing you have a nice custom background for it to draw over. I'd started a new module yesterday that does that. Nice work, btw.
Cyberwerks Heavy Industries -- viewforum.php?f=76
User avatar
honki-bobo
Posts: 306
Joined: Sat Nov 09, 2019 1:18 pm

Re: Numeric Displays

Post by honki-bobo »

UrbanCyborg wrote: Fri Feb 04, 2022 7:11 am Sorry about that, honki-bobo-san. My memory failed me.
No worries, my friend :)
UrbanCyborg wrote: Fri Feb 04, 2022 7:11 am So, that's just a text label update, eh? I'm guessing you have a nice custom background for it to draw over.
Actually I just use the textlabels background color, border color and border width features and write the numbers in bold Courier New 16px in the upper right corner of the label. The generated code looks like this:

Code: Select all

textLabel1 = new VoltageLabel( "textLabel1", "textLabel1", this, "-0.12345678" );
AddComponent( textLabel1 );
textLabel1.SetWantsMouseNotifications( false );
textLabel1.SetPosition( 17, 24 );
textLabel1.SetSize( 120, 25 );
textLabel1.SetEditable( false, false );
textLabel1.SetJustificationFlags( VoltageLabel.Justification.Right );
textLabel1.SetJustificationFlags( VoltageLabel.Justification.Top );
textLabel1.SetColor( new Color( 0, 0, 0, 255 ) );
textLabel1.SetBkColor( new Color( 65, 65, 65, 65 ) );
textLabel1.SetBorderColor( new Color( 0, 0, 0, 255 ) );
textLabel1.SetBorderSize( 1 );
textLabel1.SetMultiLineEdit( false );
textLabel1.SetIsNumberEditor( false );
textLabel1.SetNumberEditorRange( 0, 100 );
textLabel1.SetNumberEditorInterval( 1 );
textLabel1.SetNumberEditorUsesMouseWheel( false );
textLabel1.SetHasCustomTextHoverColor( false );
textLabel1.SetTextHoverColor( new Color( 0, 0, 0, 255 ) );
textLabel1.SetFont( "Courier New", 16, true, false );
UrbanCyborg wrote: Fri Feb 04, 2022 7:11 am Nice work, btw.
Thanks!
Image
Monkey Business Audio
Modules - Music - Twitter - YouTube
UrbanCyborg
Posts: 599
Joined: Mon Nov 15, 2021 9:23 pm

Re: Numeric Displays

Post by UrbanCyborg »

Kewl. I just went and looked at my debug window, where I'm using your Volt Meter as part of my setup. I had to look closely to tell that it wasn't a custom background. Fools the eye. Nicely done.
Cyberwerks Heavy Industries -- viewforum.php?f=76
Post Reply

Return to “Module Designer”