Hi, I'm just starting with Andorra, and going through the second tutorial (Part 2 - The first graphic), I found that the code for enabling fullscreen doesn't work.
All of the four lines inside begin and end in
with AdDraw.Display do
begin
Width := 800;
Height := 600;
BitDepth := ad32Bit;
DisplayMode := dmFullscreen;
end;
[code]
will send an error: Left side cannot be assigned to.
Can anyone help me? What am I doing wrong?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If you work in D 2010, then the Display property in Andorra is read-only and, as a result, members are passed over as a copy. Which you probably don't care about :)
Do this:
Go to AdDraw.pas (or ctrl+click Display property) and you will see a line like this:
property Display: TAdDisplay read FDisplay;
This is the declaration of a read-only propery and is the cause of you troubles. The easiest to do it is to set fDisplay ourselves. After all Display is just for beauty (and some protection). So go up and find the actual variable:
FDisplay: TAdDisplay;
It is in the "private" section. Move it to the "public" section:
public
FDisplay: TAdDisplay;
Best comment the line in Private and copy a new one in Public so it's easy to come back and undo it.
Now fDisplay is accessible from anywhere. Save the unit and go back to your program. Instead of using Display to set parameters, use fDisplay which is now not read only any longer.
with A.FDisplay do
begin
Width := 1920;
Height := 1080;
BitDepth := ad32Bit;
DisplayMode := dmFullscreen;
end;
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi, I'm just starting with Andorra, and going through the second tutorial (Part 2 - The first graphic), I found that the code for enabling fullscreen doesn't work.
All of the four lines inside begin and end in
hm, forgot to close the code section…
nevermind, any ideas?
If you work in D 2010, then the Display property in Andorra is read-only and, as a result, members are passed over as a copy. Which you probably don't care about :)
Do this:
Go to AdDraw.pas (or ctrl+click Display property) and you will see a line like this:
property Display: TAdDisplay read FDisplay;
This is the declaration of a read-only propery and is the cause of you troubles. The easiest to do it is to set fDisplay ourselves. After all Display is just for beauty (and some protection). So go up and find the actual variable:
FDisplay: TAdDisplay;
It is in the "private" section. Move it to the "public" section:
public
FDisplay: TAdDisplay;
Best comment the line in Private and copy a new one in Public so it's easy to come back and undo it.
Now fDisplay is accessible from anywhere. Save the unit and go back to your program. Instead of using Display to set parameters, use fDisplay which is now not read only any longer.
with A.FDisplay do
begin
Width := 1920;
Height := 1080;
BitDepth := ad32Bit;
DisplayMode := dmFullscreen;
end;