virtfile$ = DefineVirtualFile(file$, offset, size, name$)
DefineVirtualFile()
comes into play.
As parameter 1 you pass the name of the file that shall be the source
of the virtual file. Parameters 2 and 3 then define the location of
the virtual file inside file$
. The virtual file to be created will be
located inside file$
from file position offset to file position
offset+size. Parameter 4 finally specifies the file name for the virtual
file. The only thing that is important here is the file extension because
it gives Hollywood a hint of the virtual file's type. Thus, you should
make sure that you pass the correct file extension. The name does not
matter, but the file extension should be passed because not all files
can be easily identified by their header.
DefineVirtualFile()
returns a string describing the virtual file. You
can pass this string to all Hollywood functions which accept a file
name. Of course, only read access is supported by virtual files.
Attempting to write to virtual files will not work.
file$
file$
vf$ = DefineVirtualFile("hugeresource.dat", 100000, 32768, "image.png") LoadBrush(1, vf$, {LoadAlpha = True})The code above defines a virtual file inside "hugeresource.dat". The virtual file is of the size of 32768 bytes and starts at position 100000 inside "hugeresource.dat". The virtual file is a PNG image. After describing the virtual file, the image will be loaded with a simple call to LoadBrush().