Author Topic: folders Q:  (Read 3227 times)

jedione

  • Hero Member
  • *****
  • Posts: 1135
  • punktoe
    • View Profile
folders Q:
« on: January 20, 2019, 08:04:41 AM »
wondering.. does anyone know why.?

so in your layout folder you can put a  font.tff   and refrence it in the layouyt
ie:     local fonty = "captain"   like normal

now if you put that font in a folder and name the folder "fonts"  it now wont work.

but now if you put that folder in a new folder call it  "assets"     
ie:  assets>font>capitan.tff it works

were is the documentation on this...and what ells can be done as far as layout organization?

thanks
« Last Edit: January 20, 2019, 08:09:12 AM by jedione »
help a friend....

FrizzleFried

  • Sr. Member
  • ****
  • Posts: 243
    • View Profile
    • Idaho Garagecade
Re: folders Q:
« Reply #1 on: January 20, 2019, 08:11:41 AM »
I've never tried putting a font in a sub-folder... but you're saying you cant simply add the subfolder to the string?  ie: local fonty = "fonts/captain"?

That's how images and scripts work... I "assumed" that would be how fonts work too?

EDIT: I just tested and NOPE... "fonts/captain" didn't work nor did "fonts/captain.ttf"...

« Last Edit: January 20, 2019, 08:18:30 AM by FrizzleFried »
Visit my arcade blog ... www.idahogaragecade.com (updated 06-27-19)

jedione

  • Hero Member
  • *****
  • Posts: 1135
  • punktoe
    • View Profile
Re: folders Q:
« Reply #2 on: January 20, 2019, 08:13:14 AM »
correct...though have not tested on latest build,   will try that now

EDIT
ok
just tryed,  and it now works latest  build  ,,,,used to not work..  say last years build..

but still why does it just work in the folder assets with out refrencing it.....?

ie :    local fonty = "captain"
and font is in       assets>font> "capitan.tff"  and it works.
« Last Edit: January 20, 2019, 08:24:50 AM by jedione »
help a friend....

FrizzleFried

  • Sr. Member
  • ****
  • Posts: 243
    • View Profile
    • Idaho Garagecade
Re: folders Q:
« Reply #3 on: January 20, 2019, 08:19:34 AM »
correct...though have not tested on latest build,   will try that now

ok
just tryed,  and it now works used to not work..  say last years build..

but still why does it just work in the folder assets with out refrencing it.....?

Ah,  I didn't test on latest build... I too am still using older build... I'll have to move over to the latest.
Visit my arcade blog ... www.idahogaragecade.com (updated 06-27-19)

jedione

  • Hero Member
  • *****
  • Posts: 1135
  • punktoe
    • View Profile
Re: folders Q:
« Reply #4 on: January 20, 2019, 08:23:25 AM »
something abought this assets folder is special......

like its hard coded into AM,   just would like to see the documentation,
help a friend....

Bgoulette

  • Sr. Member
  • ****
  • Posts: 116
  • I wrote a book.
    • View Profile
    • BlakeGoulette.com
Re: folders Q:
« Reply #5 on: January 20, 2019, 12:24:24 PM »
You know what's even stranger? I created a folder called assets -- just because that seemed like a good name. Had no idea it was a magic word...

Anyway, I placed a couple of fonts in there, but in my layout.nut, I just reference them like this:

Code: [Select]
local fonts = {
    myFontA = "fontname1.ttf",
    myFontB = "fontname2.ttf"
}

without reference to the assets folder, and my layout still finds them! AM seems perfectly content to render this correctly:

Code: [Select]
local myText = fe.add_text("Text goes here", 0, 0, 500, 100);
myText.font = fonts.myFontA;

Maybe the above can help you (somehow)? Maybe not, but figured I'd mention it!

jedione

  • Hero Member
  • *****
  • Posts: 1135
  • punktoe
    • View Profile
Re: folders Q:
« Reply #6 on: January 20, 2019, 12:30:29 PM »
thanks, for your input on it...maybe andrew will chime in when he sees it...

to fill us in....
help a friend....