Old 06-26-2019, 04:40 AM   #1
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,900
Default Q: JSFX: gfx_loadimg path from REAPER /Data subfolder ?

Hi !


With JSFX we have gfx_loadimg( slot, filename ) which is able to load mg.


I can see from Saike code that it can look for subfoler relative to FX path like this:
File structure:
Code:
Squashman
-- \Squashman_Dependencies
---- squashman2.png

-- Squashman.jsfx

Code:
loaded = gfx_loadimg(5, "./Squashman_Dependencies/squashman2.png");

My question is : can we load img file from REAPER resource /Data subfolder ?
What would be the correct formatting ?


I tried to see in existing script but the amount of JSFX actualy using gfx_loadimg is surprisingly slow.



Thx for your help :P
X-Raym is offline   Reply With Quote
Old 06-26-2019, 08:17 AM   #2
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,900
Default

In resume the question is : where can a JSFX look for img to load for its GUI ?
X-Raym is offline   Reply With Quote
Old 06-27-2019, 02:05 AM   #3
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,900
Default

I confirm it is how it works:


Quote:
Originally Posted by JSFX doc


To use for generic data files, the files should be located in the REAPER\Data directory, and these can be opened with file_open(), passing the filename index.

You may also specify a PNG file. If you specify a file ending in .png, it will be opened from the same directory as the effect, and you can use the filename index as a parameter to gfx_blit(). -- REAPER 2.018+

Image files are only on subfolder of effects or same directory.
Other files type are under /Data folder.
X-Raym is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 07:13 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.