User Tools


reference:screen_control

Screen Control

ACLS
ACLS GRPSaveFlag,SPDEFSaveFlag,GRPFSaveFlag[,ANIMDEFSaveFlag]

Clear all display settings and return to the startup state

・If you specify arguments, you can save some settings without resetting them.

Arguments

GRPSaveFlag

If 1 is specified, the graphic page excluding the font page is saved without being cleared.

・0, if not specified.

SPDEFSaveFlag

If 1 is specified, it saves SPDEF contents.

・0, if not specified.

GRPFSaveFlag

If 1 is speciified, it saves without clearing the font page.

・0, if not specified.

ANIMDEFSaveFlag

If 1 is specified, the content defined by ANIMDEF is saved without being cleared.

・0, if not specified.

Example

'ACLS works almost the same as the following program
DEF ACLS KEEPGRP,KEEPSPDEF,KEEPGRPF
 VAR SCW=400,SCH=240

 XSCREEN SCW,SCH,2
 SPCLR
 BACKCOLOR &HFF000000
 FOR I=0 TO 3
  TSCREEN I,16,16:TPAGE I,4,1024,0
  TLAYER I,0:TOFS I,0,0,0:ATTR I,0
  COLOR I,#C_WHITE:CLS I
 NEXT
 TSCREEN #TCONSOLE,16,8:TPAGE #TCONSOLE,4,1024,0
 TLAYER #TCONSOLE, 0:TOFS #TCONSOLE,0,0,-4095:ATTR 0
 COLOR #C_WHITE:CLS
 IF !KEEPGRP THEN
  FOR I=0 TO 5:GTARGET I:GCLS:NEXT
  LOADG "GRP:#SYS/DEFGRP",4
 ENDIF
 IF !KEEPGRPF THEN
  LOADG "GRP:#SYS/DEFFONT",#GRPF
 ENDIF
 GTARGET 0
 GCOLOR #C_WHITE
 GCLIP 0,0,#GRPWIDTH-1,#GRPHEIGHT-1
 SPSET #GSPRITE,0,0,SCW,SCH,0,1
 SPPAGE #GSPRITE,0
 SPLAYER #GSPRITE,0
 SPOFS #GSPRITE,0,0,4095
 IF !KEEPSPDEF THEN
  SPDEF
 ENDIF
 ANIMDEF
 FOR I=0 TO 7:LAYER I:LFILTER I:LCLIP I:LMATRIX I:NEXT
 FADE 0
END

XSCREEN Width,Height[,SampleMagnification[,CompositeMode[,AspectRatio]]]

Set the display resolution

・The size of the console (text screen 4) is changed according to the width and height.
・Other text screen settings remain the same.
・Graphic page sprite settings are changed according to the width and height.

Arguments

Width,Height

Specify the display width and height in pixels

Width: 128 to 1280

Height: 128 to 720

・A number that can be divided by 4 can be specified for both width and height.

SampleMagnification

Pixels can be subdivided to express rotation and enlargement more smoothly.

・It can be specified 1 or more, the product of width multiplied by sample magnification should be up to 1280, and the product of height multiplied by sample magnification should be up to 720.
・1, if not specified.

Composition mode

Specify the drawing method when the BASIC display is finally combined with the indicating display

0 Bilinear
1 Smart Nearest Neighbor
2 Nearest Neighbor

・0 is smooth pixel corner, but the whole image is blurred.
・2 is a clear display as a whole, but the pixel corners are jagged.
・1 is between 0 and 2.
・0, if not specified.

AspectRatio

Display aspect ratio: 0.1 to 10

・Square at 1, vertical when smaller than 1, horizontal when larger than 1.
・If not specified, width / height is set.

XSCREEN OUT Width,Height [,SampleMagnification[,CompositeMode[,AspectRatio]]]

Get display resolution

Return Value

Width,Height

The width and height of the display (in pixels)

SampleMagnification

CompositeMode

AspectRatio

ANIMDEF DefinitionNumber,AnimationTarget,DataArray [,Loop]

Animation definition

・The defined animation can be used with SPANIM and TANIM commands.

Arguments

DefinitionNumber

Animation definition number: 0 to 1023

AnimationTarget

Numeric value or string that manages the element to be changed

0 "XY" XY Coordinates
1 "Z" Z Coordinate
2 "R" Rotation Angle
3 "S" Magnification XY
4 "C" Display Color
5 "V" Variable (value of sprite variable 7)
6 "UV" UV Coordinates (definition source image coordinates)
7 "I" Definition Number

・If you add "+" to the end of the string or add 8 to the value, it will be the relative value from the animation start point.
・If you add "." to the end of the string or add 16 to the value, the sprite will be deleted when the animation ends.

DataArray

1D numeric array that stores animation data

Loop

Loop count: 1 or more

・Specify 0 to make an infinite loop.
・1, if not specified.

DataArray

・Animation data is prepared in the following order in the numerical array (up to 32).
・Time1,Item1,[Item2,] Time2,Item1,[Item2,]...

Example

DIM PANIM[ 6 ]
PANIM[0]=-60 'frame(-60=smooth)
PANIM[1]=200 'offset X,Y
PANIM[2]=100
PANIM[3]=-30 'frame
PANIM[4]=50 'offset
PANIM[5]=20
ANIMDEF 0,"XY",PANIM

ANIMDEF DefinitionNumber,AnimationTarget,@Label[,Loop]
ANIMDEF DefinitionNumber,AnimationTarget,LabelString[,Loop]

Animation definition (specified with DATA command)

・The defined animation can be used with SPANIM and TANIM commands.

Arguments

DefinitionNumber

Animation definition number: 0 to 1023

AnimationTarget

Numeric value or string that manages the element to be changed

0 "XY" XY Coordinates
1 "Z" Z Coordinate
2 "R" Rotation Angle
3 "S" Magnification XY
4 "C" Display Color
5 "V" Variable (value of sprite variable 7)
6 "UV" UV Coordinates (definition source image coordinates)
7 "I" Definition Number

・If you add "+" to the end of the string or add 8 to the value, it will be the relative value from the animation start point.
・If you add "." to the end of the string or add 16 to the value, the sprite will be deleted when the animation ends.

@Label

The first label of the DATA command that stores the animation data

LabelString

A string containing the label name can be specified instead of the label.

Loop

Loop count: 1 or more

・Specify 0 to make an infinite loop.
・1, if not specified.

Data

Animation data is prepared in the following order in the DATA instruction

DATA NumberOfKeyFrames(up to 32)
DATA Time1,Item1[,Item2]
DATA Time2,Item1[,Item2]
:

Example

@MOVDATA
DATA 2 'counter
DATA -60,200,100 'frame,offset
DATA -30,50,20 'frame,offset
ANIMDEF 0,"XY",@MOVDATA

ANIMDEF DefinitionNumber,AnimationTarget,Time1,Item1[,Item2][,Time2,Item1[,Item2]]...[,Loop]

Animation definition (specify as direct arguments)

・The defined animation can be used with SPANIM and TANIM commands.

Arguments

DefinitionNumber

Animation definition number: 0 to 1023

AnimationTarget

Numeric value or string that manages the element to be changed

0 "XY" XY Coordinates
1 "Z" Z Coordinate
2 "R" Rotation Angle
3 "S" Magnification XY
4 "C" Display Color
5 "V" Variable (value of sprite variable 7)
6 "UV" UV Coordinates (definition source image coordinates)
7 "I" Definition Number

・If you add "+" to the end of the string or add 8 to the value, it will be the relative value from the animation start point.
・If you add "." to the end of the string or add 16 to the value, the sprite will be deleted when the animation ends.

Time,Item

・Animation data itself (up to 32 as many as necessary).

Loop

Loop count: 1 or more

・Specify 0 to make an infinite loop.
・1, if not specified.

Example

ANIMDEF 0,"XY",-60,200,100,-30,50,20

ANIMDEF DefinitionNumber

Clear the animation of the specified definition number

Argument

DefinitionNumber

Animation definition number to clear: 0 to 1023

Example

ANIMDEF 0

ANIMDEF

Clear all animation definitions

Example

ANIMDEF

BACKCOLOR BackgroundColor

Set the background color of the BASIC display

Argument

BackgroundColor

Background color code

BACKCOLOR()

Get background color of the BASIC display

Return Value

Background color

Set background color code

FADE FadeColor

Apply a fade effect to the display

・The effect is the same as covering the entire display with a sprite filled with a fade color.

Argument

FadeColor

Fade color code

・The greater the alpha component, the darker the color.

FADE FadeColor,Time

Apply fade-in and fade-out effects

・Over time, change the fade color gradually from the current fade color to the specified color.

Arguments

FadeColor

Fade color code

・The greater the alpha component, the darker the color.
・If the alpha component is 255, it's fade out effect.
・If the alpha component is 0, it's fade-in effect.

Time

Specify the fade effect time with the frame count

・If there is no processing loss, 60 is 1 second.

FADE()

Get the current fade color

Return Value

Current fade color

・You can also get the color during fade-in/fade-out.

FADECHK()

Check if it's during fade-in/fade-out

Return Value

1 if it's during fade-in/fade-out, 0 if not

reference/screen_control.txt · Last modified: 2023/12/07 15:55 (external edit)

Page Tools