Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getinfos() return null tables for AM classes' functions #639

Open
oomek opened this issue Jul 28, 2020 · 10 comments
Open

getinfos() return null tables for AM classes' functions #639

oomek opened this issue Jul 28, 2020 · 10 comments

Comments

@oomek
Copy link
Collaborator

oomek commented Jul 28, 2020

When I run the following:

foreach ( m in instance.getclass() )
{
	if ( typeof(m) == "function" )
	{
		foreach ( f in m.getinfos() )
		 	::print( f + "\n" )
	}
}

I get null fields for fe.Text fe.Image etc

0
true
(null : 0x0000000000000000)
(null : 0x0000000000000000)

When I use an instance of my own class I get some meaningful data:

on_tick
(array : 0x0000000008655000)
false
0
D:\EMU\ATTRACTMODE\layouts/test smoothing/inertia.nut
(array : 0x0000000008654100)

Do you know by any chance what may be causing it?
I've created an inertia class that adds nice physics based animation to any fe. object and parameter, but I'm having problems diverting class functions like set_rgb(r,g,b) and I wouldn't like to hardcode them as it supposed to be universal and work on any object.

@oomek oomek changed the title getinfos() return null tables for AM classes functions getinfos() return null tables for AM classes' functions Jul 28, 2020
@rogalian
Copy link

If I run this code in mine I get the below error:
`Script Error in /home/rogalian/.attract/layouts/Verticools Deluxe/layout.nut - the index 'instance' does not exist

Reason for trying - I want to know if it's possible to find + reuse the font size AM is using in it's configuration menu (at low resolutions it always appears to render its own text really well with no tricks required)

@oomek
Copy link
Collaborator Author

oomek commented Jul 28, 2020

You have to create an instance object first for example local instance = fe.add_text("test",0,0,100,100) and compare the console output with an instance of some class local instance = SomeClass()

@oomek
Copy link
Collaborator Author

oomek commented Jul 28, 2020

I don't think that you can access the font size AM is using for the overlays. What kind of tricks you're refering to?

@rogalian
Copy link

rogalian commented Jul 28, 2020 via email

@oomek
Copy link
Collaborator Author

oomek commented Jul 28, 2020

Forget about oversampling. I'm finishing my Signed Distance Field font renderer which allows smooth scaling fonts in AM and additionally you get outline, shadow and glow for free, no expensive blurs required. This class can be adopted for pixelated bitmap fonts. That's the only sane solution for 240p

@oomek
Copy link
Collaborator Author

oomek commented Jul 28, 2020

Kerning of small fonts is totaly broken but it's caused by SFML not AM. I was trying to fix it on SFML repo, but the discussion went to a stall.

@rogalian
Copy link

Forget about oversampling. I'm finishing my Signed Distance Field font renderer which allows smooth scaling fonts in AM and additionally you get outline, shadow and glow for free, no expensive blurs required. This class can be adopted for pixelated bitmap fonts. That's the only sane solution for 240p

Apologies it's way off your bug topic to jump in like this! I understand your explanation about the instance, thanks. I also get the nulls.

At 320x240 I agree, bitmap is end-game but oversampling isn't too bad. 640x240 with oversampling looks very good. If you can improve on it cheaply I'm keen to try your renderer.

@oomek
Copy link
Collaborator Author

oomek commented Jul 28, 2020

Coming back to the topic, I was trying to use the _call metamethod, but ti's not firing. @mickelson do you know why by any chance?

@mickelson
Copy link
Owner

mickelson commented Jul 28, 2020 via email

@oomek
Copy link
Collaborator Author

oomek commented Jul 28, 2020

I did some more experiments. _call function fires, but only when you call the instance itself instance() calling class functions does not unfortunately. It's a bit disapponting that I cannot override the class function members like I _get, _set with non function class members.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants