I Think This May Be a Bug

Discuss suspected bugs with other users and Sim Innovations Staff

Moderators: russ, Ralph

Post Reply
Message
Author
The Artful Dodger
Posts: 204
Joined: Sat Jul 09, 2022 3:20 pm

I Think This May Be a Bug

#1 Post by The Artful Dodger »

Hello:
****** UPDATE ******
I have done further testing (actually, there was a lib function but never called so I didn't think it was important!) but it turns out that it was. In fact, I created a new panel and instrument, with just the code below, and it works fine. So, even though the lib function wasn't called, it did have an impact on the execution of the display!
I apologize to anyone that tried to duplicate the error (unsuccessfully I would bet)!
****** UPDATE ******
Now, back to your regularly scheduled message!

Sparky
____________________________________________________________________________________________
I was just "playing with an idea" when I noticed what I think must be a bug. First, here's the code:

Code: Select all

MyDarkGreen  = "#008000"
MyGold       = "#FFD700"
MyLightGreen = "#80FF80"
MyPurple     = "#9932CC"
MyRed        = "#FF0084"
--
MCPPanel  = canvas_add(  0, 0, 804, 150)
--
	canvas_draw(MCPPanel, function()
--
		_rect(3, 3, 799, 145)
		_stroke(MyGold, 5)
--
		_rect(5, 5, 794, 140)
		_fill(MyDarkGreen)
--
	end)
And here's what it looks like when I "play" it in Create/Edit:
Image without Error.png
Image without Error.png (895 Bytes) Viewed 721 times
That's exactly, to the pixel, to what I intended.
But, here's what "plays" when I start it from the AM home tab:
Image with Error.png
Image with Error.png (913 Bytes) Viewed 721 times
You can see that at the top there's one pixel high of black, four pixels of black to the right (and the gold is short of where it should be) and the green is one pixel short to the right and one pixel short on the bottom.
I duplicated this several times, including after a fresh restart of windows.
logic.lua
(894 Bytes) Downloaded 47 times
I also attached a copy of my lua file.
Explanation, please.

Sparky

User avatar
jph
Posts: 2846
Joined: Fri Apr 10, 2020 12:50 pm
Location: Somewhere over the rainbow..

Re: I Think This May Be a Bug

#2 Post by jph »

Hi you still need to consider 'stroke' is in pixels and using an odd number then where do you start and end ? as the theoretical stroke is equidistant either side of the start point. ?
Don't forget you can't have half a pixel. ;)
your code should be balanced when drawing within areas as in

Code: Select all

		_rect(3, 3, 798, 144)
		_stroke(MyGold, 6)
--
		_rect(6, 6, 792, 138)
		_fill(MyDarkGreen)
Anyway, you seem to have it to your liking so that is good.
Joe. CISSP, MSc.

SimPassion
Posts: 5336
Joined: Thu Jul 27, 2017 12:22 am

Re: I Think This May Be a Bug

#3 Post by SimPassion »

 
In AM 4.1.5, apart changing the font name I don't have and commenting out the wav part, I have no issue with the following settings below, in the panel right pane Windows preferences from Home tab :

image.png
image.png (906 Bytes) Viewed 698 times
image.png
image.png (11.96 KiB) Viewed 698 times

Though it doesn't seem to display on AM 4.2 Beta 4, @Corjan

Code: Select all

--====================================================================================
--								CHECK PURPOSE
--====================================================================================

--**********************************************************************
--                                                                     *
--	Set up some required local constants.                              *
--                                                                     *
--**********************************************************************
--
local RGG_42_HAR_VAC     = "font:roboto_regular.ttf; size: 42px; color: #FFD700; halign: right; valign: center; weight: bold;"
--
-- MyClick = sound_add("ButtonClick.wav", 0.5)
--
MyDarkGreen  = "#008000"
MyGold       = "#FFD700"
MyLightGreen = "#80FF80"
MyPurple     = "#9932CC"
MyRed        = "#FF0084"

MCPPanel  = canvas_add(0, 0, 804, 150)

	canvas_draw(MCPPanel, function()
--
		_rect(3, 3, 799, 145)
		_stroke(MyGold, 5)
--
		_rect(5, 5, 794, 140)
		_fill(MyDarkGreen)
--
	end)

 

The Artful Dodger
Posts: 204
Joined: Sat Jul 09, 2022 3:20 pm

Re: I Think This May Be a Bug

#4 Post by The Artful Dodger »

Hello, SimPassion:
You mentioned you don't have the font, so here it is. I like it!
RightGrotesk-CompactMedium - Copy.otf.zip
(102.16 KiB) Downloaded 46 times
Note that it is not a zip file - I simply added the letters ".zip" to the file name. Remove them and you are good to go.

{Question - is that a legal thing, in Sim Innovations terms, to by-pass their limitations in this way? If so, let me know and I'll not do it again!!}

Sparky

The Artful Dodger
Posts: 204
Joined: Sat Jul 09, 2022 3:20 pm

Re: I Think This May Be a Bug

#5 Post by The Artful Dodger »

Joe:
I am sorry but I don't understand any of what you said.
When I set out to make an object, I lay it out in my graphics program, to the pixel. Then, I give the AM the request, for example, _rect. Then I have AM play the "instrument", make a screen view of the "instrument" as the AM has made it, and then adjust the numbers in the _rect accordingly!
What goes into the green box (it was intended merely to start the instrument up) is my attempt at an HUD MCP:
preview - Disengage On.png
preview - Disengage On.png (9.21 KiB) Viewed 694 times
So, that's how I lay out my instruments. Here's one with a black background:
preview.png
I have changed it a bit from the black one - that's why it's different. Plus, the gold on the switches turn on and off as required.

Sparky

SimPassion
Posts: 5336
Joined: Thu Jul 27, 2017 12:22 am

Re: I Think This May Be a Bug

#6 Post by SimPassion »

The Artful Dodger wrote: Thu Nov 10, 2022 6:34 pm Hello, SimPassion:
1 - You mentioned you don't have the font, so here it is. I like it!RightGrotesk-CompactMedium - Copy.otf.zip Note that it is not a zip file - I simply added the letters ".zip" to the file name. Remove them and you are good to go.

2 - {Question - is that a legal thing, in Sim Innovations terms, to by-pass their limitations in this way? If so, let me know and I'll not do it again!!}

Sparky
Hi Sparky

1 - Thanks, though there was no issue not having the font itself while testing, this was only to remove any unwanted background error when running the instrument, by replacing by an embedded one and eventually the font style wasn't used anywhere through the piece of code which was posted, in any case

2 - if you mentioned assing the zip extension, this is only an often seen workaround on many other forums than here and no issue I guess

Post Reply