Sui's 5 second Custom Resource Tutorial[size=0.5]
By no means is this comprehensive. It's quick and dirty, but should get you throwing up a resource in under 5 minutes[/size]
For a start, you'll need the actual resource. It'll need to be in either .jpg, or .paa format. You'll want to make the size to a power of 2. eg:
128x64
256x128
64x128
128x128
1024x512
Basically any combination of x and y you want, provided
the size is a power of 2.
Next we'll take a look at the .ext entry... heres one I pulled from one of my missions:
class RscPicture
{
type=0;
idc=-1;
style=48;
colorBackground[]={0,0,0,0};
colorText[]={1,1,1,1};
font="tahomaB24";
size=0;
};
class RscTitles
{
class Title
{
idd=-1;
movingEnable=0;
duration=8;
name="Title";
controls[]={"Title"};
class Title: RscPicture
{
text="Title.paa";
x=0.200000;
y=0.200000;
w=0.600000;
h=0.600000;
};
};
};
The first bit (class Picture) is the parent class. This defines what all classes using
Picture will be. 48 (check the style) is OFP speak for "Picture".
Then we move on to defining our resource(s). I'm using a class called "Title", but you can use whatever name you want. Just make sure you call it correctly using your script or trigger
If we take a look at this bit here:
...
class Title
{
idd=-1;
movingEnable=0;
duration=8; name="Title"; controls[]={"Title"};
class Title: RscPicture {
text="Title.paa";
x=0.200000;
y=0.200000;
w=0.600000;
h=0.600000;
};
};
...
I'll just cover the underlined bits for now (the other parts are optional unless you want to use them... they're mainly for dialog controls I think...)
- duration=8;: This is how long your resource will remain on the screen.
- name="Title";: The name of your resource as will appear in the trigger dropdown menu. Just note this is not the actual name of your resource (as you would use with the cutrsc/titlersc scripting command). That name is found at the top, in this case: Class Title
- class Title: RscPicture: This bit just defines the parent class of this resource. It's using RscPicture, which we have already told OFP is a picture (style 48).
Now down to the bit you're going to have fun mucking around with:
text="Title.paa";
x=0.200000;
y=0.200000;
w=0.600000;
h=0.600000;
The first line defines the file that your resource will use. In this case, I had a picture in .paa format, I called "title.paa".
The next two lines define the resources position on the screen. Just note they are in
percentage of screen distance. The range is from 0 to 1. So 0.5 is half way across (or up) the screen.
The values here (x = 0.2, y = 0.2) mean that the resource will appear 20% from the left of the screen, and 20% from the top. The great thing about this is that it doesn't matter about the size of the resource you are using, you'll always work with screen percentages...
The next two lines define how large your resource appears
on the screen. Again, these are percentages of screen size... range from 0 to 1.
If you wanted your resource to fill up 80% across the screen, you'd use:
w=0.8
The values there (w=0.6, h=0.6) mean the resource fills up 60% of the screen (across and up).
Anyway, that was very quickly covered. You'll need to do some experimentation on your own to get exactly what you're after...
But the more you muck around, the easier it is to understand this stuff
Good Luck mate