iOS dependent functions


[Return]
All functions list is here.


// Screen structure


X-BASIC' has screen as below (as same as X68000).
Text screen 1 screen
Graphic screen 4 screens
Sprite&BG screen 1 screen
(Sprite and BG screen exist only when you enable the sprite function).
These screens are independent, drawing is done separately, you can overlap with the priorities.

In addition, X-BASIC' also has screen as below.
Key display screen 1 screen
Bitmap (Virtual graphic screen) 4 pages
Key display screen is used to display the function key or touch region.
This is is always the highest priority (= most foreground).
The bitmap is a virtual graphic screen. It does not draw directly to the screen, but you can draw on ultra-high-speed processing.
One bitmap page is allocated with each graphics screen.

Screen resolution is depending on the direction and the device model (except bitmap and BG screen).
Whether retina does not affect the resolution.
The resolution and direction of the screen is fixed at RUN.
  Portrait Landscape
iPad 768*960 1024*660
to iPhone4S/
iPod touch4
320*372 480*224
iPhone5(s)/
iPod touch5
320*548 568*224
iPhone6 375*623 667*331
iPhone6 Plus414*692 736*370
You can get screen resolution by getScreenSize().
If you need screen rotation, you call screenRotate() function.
But the resolution is fixed always. When you rotate device, screen scale is changed to fit the long side in the screen.
Unlike the real X68000, it can not be changed screen resolution and number of colors (32bit color fixed).

About changing of text displaying at v3.0 later
In v3.0 later, to correct the text display bug, the process of calculating the one character size has been changed.
For this reason, it may be different display results with previous versions.
It is the following points of the modified.
Changed contentsWhat will changeFixed bug
The width of the font has to be an integer unit. When the screen resolution is not divisible by text width set in width(), there is room in the right side of screen. When displayed with attribute, open a gap between characters.
The height of the font has to be an integer unit. The number of lines in one screen may be reduced. When it is turned on and off the reverse attribute at the same display position, it may remain like an underline.
Corresponding to the descender of the font. The number of lines in one screen is reduced. The font descender is not display.
If you overwrite text character, sometime it remains previous character pattern on the text screen.
If you have some trouble of display, please turn "Old display compatible" on in the Settings.
If you consider about the descender of the font, you must set it by width().
(Actually, I wanted to leave the always correspond. However, the number of text rows will be quite decrease.
So the influence range is large, I decided to be set by the user.)

Attention :
The sprite function is so heavy in curren version.
You may use the sprite with a fixed manner and no move.
Or you may use it as other superimposed screen.
This is because my skill shortage. sorry.


// About color value

Basically, The color value in the X-BASIC' is specified by 8bit R,G,B and 8bit alpha value separately.
This is called "separate RGB value".

You can use "composite RGB value" that is a summary of RGB and alpha values in 32bit number.
Many functions that deal with color, automatically identify them depending on how to give the argument.

All sprite functions are specified by composite RGB value.

I also provide a function that determines the composite RGB color value from HSV color space values.
More about HSV color space, please look here.

// Text Screen functions

Text Screen is the screen to draw on a character-by-character basis.

In X68000, rows and columns were determined by the screen resolution.
In the X-BASIC', the font size is change by width() to fit the number of digits.
Therefore, the number of digits can be set free basically.
I call this text coordinate mode.

In the text coordinate mode, the display digits are fixed position.
So it  is  constant between the each characters even if you use a proportional font.

When you go to the right edge of the screen display, come to the left edge of the next line.
When the bottom line, screen scrolls up.

In the text screen, you can select the font type and size by font().
However, when larger than the size that is determined by the width(), 
it is not displayed correctly if the display of characters to overlap.

It becomes "graphic coordinate mode" if the specified width(0).
In this case, coordinate display can take any graphic coordinate range of the screen resolution.

Both coordinate mode difference is as follows.
  text coordinate graphic coordinate
coordinate character unit pixel unit
x coordinate 0 to x-width-1 is specified by width() 0 to Graphic Screen width-1
y coordinate 0 to y-height-1 is specified
by width() or calculated
0 to Graphic Screen height-1
Display each at text coordinate Continuous drawing the entire string
from the first coordinate
Proportional font Disable Enable
Auto new line
at screen right edge
do None
display control code Execute only at 1 character some codes invalid
printCtrlCode() Enable all Disable cursor move
New line Enable move to line top(x=0)
tab() To next tab column one space
At character overlap erase under character Overlaid(erasable)
New line at the bottom line scroll up(Can set disable) scroll disable
The number of digits used in one character (half-em) is not being determined by the character code
It is determined by the width of the real display.
However, the range of SHIFT-JIS code should be the same as the results in X68000.

In X-BASIC/68, multi-byte characters can view the output in bytes.
However, in the iOS version, it can not.
If you need absolutely, please handle with the chars2Sjis() / chars2UTF8().

The scroll area of text screen is always full screen.
(Text screen scrolling region in X68000 actual machine, was to the top of the function keys.)
Name font
Format font(fontName;str[,pointSize;float])
Function Set text font name and size.
Argument
fontNameFont name
pointSizeFont size
In text coordinate mode, this is omitted basically.
Return value None
Note
  • If it can not find the specified font, it sets the default font(monospaced font).
  • When you set monospaced font, double-width character is displayed using two columns.
    When you set non monospaced font, all character is displayed using one column.
    Therefore, even if you set same the number of columns by width(),
    the character size will be larger using the monospaced font than non-monospaced font.

Name fontSize
Format float fontSize(message;str,fontName;str,pointSize;float[,wy;float])
Function Calculate display width and height of strings.
Argument
message strings
fontName Font name
pointSize Font size
In text coordinate mode, this is omitted basically.
wy The variable to return to display height. When you omit , it does not return height.
Return value display width
Sample keyMap.bas

Name width
Format int width(wx;int[,wy;int][,fzenhan;int][,fdescender;int][[,baseCharacterSet;int],baseCharacter;str])
Function Determine the number of columns and rows to the text screen.
Font size is calculated automatically as to match the number of columns.
At the same time, determine the graphic coordinate mode or text coordinate mode.
The number of columns is always made to the number specified.
But the number of rows, by the result of calculation, it may be less than the number specified(not increased).

If you use a text coordinate mode, you have to call in the order of font() to width() basically.
If you do not, the setting of the row is not performed to according to the font size information (If you use the font of the same type, re-setting is not required).
In text coordinate mode, the font size is determined by the width(),
but large font may not fit in the width of one column and row that has been calculated (such as Zapfino).
In that case, you control display by using the graphic coordinate.

In addition, width() is not clear the screen.
Argument
wxthe number of columns
=0graphic coordinate mode
>=8 and even onlyFont size is calculated automatically as to match the number of digits.
wythe number of rows
=0Automatically set by wx(default)
>0Only when less than the number of rows that are automatically calculated,
it sets the specified number of rows.
When the graphic coordinate mode, it is meaningless.
fzenhanReturns whether it processes double-width character with one digit or two digits.
For returns a value, you must give by variable.
NO All character use 1 digit.
In the graphic coordinate mode, it returns NO always.
YESDouble width character uses 2 didits.
This value is set by the font set by the last font().
It will be YES under the following conditions (otherwise it is NO).
  1. It is a monospaced font.
  2. The part of ASCII font width is less than or equal to double-width characters.
If YES, &h8140 to &hEAFC characters in SHIFT-JIS are treated as a double-width character regardless of its display width.
fdescenderWhether consider about the descender of the font when calculate the number of text rows (Descender correspondence).
NO Not consider(Defualt)
YESConsider
  1. If you set YES, text rows will be quite decrease. So, please set to YES only when necessary.
  2. Note that even if you set YES, lower side of character will be missing in some fonts.
    Example : MigMix
    This is the problem of information inside the font , it can not be resolved automatically.
  3. In addition to the g and y, some of emoticons(such as 🐓🏿) uses full of descender area.
    When you display these character and overwrite it, you may not be displayed correctly without fdescender = YES.
baseCharacterSetSet the base character for calculating by the number (enable only at non-monospaced font).
0あ(default)Standard setting
1🐓When using many pictogram.
2When using many wide width character such as 'W'.
3When using many wide height descender character such as 'g'.
baseCharacterSet the base character for calculating by the string (enable only at non-monospaced font).
Basically, you set the biggest character to be displayed in the program.
Only first character is valid. When you set this, baseCharacterSet is ignored.
When you set this without contemplation, the displaying of text character may become abnormality.
Please set so careful.
Return value the number of actual rows
Note
  • If you execute width(except 0), the cursor position move to home=(0,0).
    When you execute width(0), the cursor is not move.
  • iOS font has a highly freedom.
    Therefore, the system cannot guarantee to display correctly in each setting.
    Please check at each case.
Sample utfTest.bas,gonbe.bas,reverseTest.bas,stacky.bas

Name getWidth
Format int getWidth([wx;int][,wy;int][,fzenhan;int][,fontWx;float][,fontWy;float])
Function Get current text screen width and height.
Argument
wxReturn text screen width. For returns a value, you must give by variable.
In text coordinate mode, return the number of characters.
In graphic coordinate mode, return the number of pixels.
wyReturn text screen height. For returns a value, you must give by variable.
In text coordinate mode, return the number of lines.
In graphic coordinate mode, return the number of pixels.
fzenhanReturns whether it processes double-width character with one digit or two digits.
For returns a value, you must give by variable.
The return value is same as width()'s one.
fontWxX width of text 1 column. For returns a value, you must give by variable.
fontWyY width of text 1 row. For returns a value, you must give by variable.
Return value
NO Text coordinate mode
YESGraphic coordinate mode

Name isLandscape
Format int isLandscape([mode;int])
Function Whether the screen is landscape or portrait.
Or, return current device orientation.
Argument
NO or defaultWhether the screen is landscape or portrait.
YESreturn current device orientation
Return value
At mode=NO
YESThe screen is landscape.
NO The screen is portrait.
At mode=YES
DEVICE_ORIENTATION_UNKNOWN Unknown
DEVICE_ORIENTATION_PORTRAIT Portrait(Home button is downside)
DEVICE_ORIENTATION_PORTRAITUPSIDEDOWN Upside down portrait(Home button is upperside)
DEVICE_ORIENTATION_LANDSCAPELEFT Left landscape (Home button is right side)
DEVICE_ORIENTATION_LANDSCAPERIGHT Right landscape (Home button is left side)
DEVICE_ORIENTATION_FACEUP Face up
DEVICE_ORIENTATION_FACEDOWN Face down
Note When mode=NO, it will examine whether the screen is horizontal long.
Basically , X-BASIC fix the screen direction at RUN.
So, after RUN, regardless of the orientation of the device, it does not change.
When mode=YES, it will examine the device orientation in real time.
It will change regardless of the fixing of the screen direction.
Sample compass.bas,joystick1.bas

Name setUpScroll
Format setUpScroll(fscroll;int)
Function Set scroll up status of the text screen.
From V2.0, when you issue a new line in the bottom line of the text screen, it is scrolled up.
For this reason, the program made =with previous versions, the display may be shifted.
At that time, you can set be disable to scroll up.
Argument
fscroll
YESEnable to scroll up (Default)
NO Disable to sctoll up
Return valueNone

Name locate
Format int locate(x;int,y;int)
Function Set cursor coordinate.
Argument
x,ydisplay coordinate
According to the setting of the width (), you give a graphic or text coordinate.
Return value
NO Coordinate is in screen(Normal)
YESIt was corrected for the off-screen coordinates.
Correction method are as follows:
x<0,y<0become =0
x>=screen widthx=0,y=next line
y>=screen heighty=bottom line

Name gLocate
Format int gLocate(x;int,y;int)
Function When you set the text screen to the graphic coordinate mode by width(0), set the coordinate with text coordinate value approximately.
Argument
x,ytext coordinate
Return value
NO Coordinate is in screen(Normal)
YESIt was corrected for the off-screen coordinates.
Correction method are as follows:
x<0,y<0become =0
x>=screen widthx=0,y=next line
y>=screen heighty=bottom line
Note This function calculates graphic coordinate approximately with one character size = x width is 8, y height is 16.
The string print in graphic mode is not same as in text coordinate mode, so necessarily display position does not match.
You can not use this without in the graphics coordinate mode.

Name home
Format home()
Function Set cursor to home(x=0,y=0)
ArgumentNone
Return value None

Name cls
Format cls()
Function Clear text screen and cursor move to the home.
ArgumentNone
Return value None

Name pos
Format int pos()
Function Get cursor x coordinate
ArgumentNone
Return value cursor x coordinate
The range of values returned can vary by the coordinate mode.

Name csrlin
Format int csrlin()
Function Get cursor y coordinate.
ArgumentNone
Return value cursor y coordinate
The range of values returned can vary by the coordinate mode.

Name textX2Gx
Format int textX2Gx(x;int)
Function Covert text coordinate x position to graphic coordinate x position.
Mainly, it used to obtain the coordinates for setTouchArea() that is described below.
Argument
xtext coordinate x position
Return value graphics x position

Name textY2Gy
Format int textY2Gy(y;int)
Function Covert text coordinate y position to graphic coordinate y position.
Mainly, it used to obtain the coordinates for setTouchArea() that is described below.
Argument
ytext coordinate y position
Return value graphics y position

Name tColor/tcolor
Format tColor(r;int,g;int,b;int[,alpha;int])
tcolor(r;int,g;int,b;int[,alpha;int])
Function Set text drawing color.
Argument color component
If you set r only, it is regarded as a composite RGB value.
Example :
tColor(&hffffffff) :// highlighted white

You are able to set standard color by following constants:
CTBLACK black CTHBLACK black
CTBLUE blue CTHBLUE highlighted blue
CTRED red CTHRED highlighted red
CTMAGENTA magenta CTHMAGENTA highlighted magenta
CTGREEN green CTHGREEN highlighted green
CTCYAN cyan CTHCYAN highlighted cyan
CTYELLOW yellow CTYELLOW highlighted yellow
CTWHITE white CTHWHITE highlighted white
Example
tColor(CTHWHITE) :// highlighted white
------------------------------------------------------------------
When you specify even after g, it assumed to be specified separate RGB value.
rred-component0 to 255
ggreen-component0 to 255
bblue-component0 to 255
alphaTransparency0 to 255
default is 255
If you set r<0,g=0,b=0, then it is able to set standard color.
You are able to set standard color by following constants:
TBLACK black THBLACK black
TBLUE blue THBLUE highlighted blue
TRED red THRED highlighted red
TMAGENTA magenta THMAGENTA highlighted magenta
TGREEN green THGREEN highlighted green
TCYAN cyan THCYAN highlighted cyan
TYELLOW yellow TYELLOW highlighted yellow
TWHITE white THWHITE highlighted white
Example
tColor(-THWHITE,0,0,255) :// highlighted white
Return value None

Name tAtrb/tatrb
Format tAtrb(atrb;int)
tatrb(atrb;int)
Function Set display attribute.
Argument
atrbattribute
ATRB_NORMAL Normal
ATRB_UNDERLINE Underline
ATRB_CANCEL Cancellation line(signle line)
ATRB_CANCEL2 Cancellation line(double line)
ATRB_REVERSE Reverse
ATRB_BOLD Bold
ATRB_CENTERING Centering(text coordinate mode and non-monospaced font only)
ATRB_CLEAR Erase under character
Graphic coordinate mode only.
(This is set automatically in text coordinate mode.)
You can specify some attributes at the same time with OR.
Each attribute result(except centering)Centering
Above: Normal (left-justified)

Under: Centering
Return value None
Note
  • Italics is set by font type.
  • Bold is produced by the calculation. Therefore, there is a possibility that small part is not clear.
    If you want to use a clean bold, please set the bold-font by font().
SamplenewlineTest.bas

Name tBorder/tborder
Format tBorder(width;float,r;int[,g;int,b;int[,alpha;int]])
tborder(width;float,r;int[,g;int,b;int[,alpha;int]])
Function Draw a border to the text screen
Argument
widthborder width ; >0
r,g,b,alphaeach color component
How to specify the color component is the same as tColor().
Return value None

Name tBackgroundAlpha
Format tBackgroundAlpha(alpha;float)
Function Set transparency of the text screen.
Argument
alphaTransparency=0.0 to 1.0
It will lower the value, it will be more transparent.
Note you will no longer see at 0.0.
Return value None

Name tBackgroundColor
Format tBackgroundColor(r;int[,g;int,b;int[,alpha;int]])
Function Set background color of the text screen.
Argument
r,g,b,alphaeach color component
How to specify the color component is the same as tColor().
Return value None

Name tab
Format tab(cnt;int)
Function Display tabs.
1TAB is 8 columns.
This is enable in text coordinate mode. If this use in graphic coordinate mode, spaces is displayed instead of the tab.
Argument
cntNumber of tab(>=0)
In the graphic coordinate mode, this is the number of single spaces.
Return value None

Name cursorMove
Format cursorMove(direc;int[,cnt;int])
Function Move cursor in the specified direction and number of times.
Enable at text coordinate mode.
Argument
direc
CURSOR_DIREC_UP up
CURSOR_DIREC_DOWN down
CURSOR_DIREC_LEFT left
CURSOR_DIREC_RIGHT right
CURSOR_DIREC_UP_WITH_SCROLL up ; down scroll at the top line
CURSOR_DIREC_DOWN_WITH_SCROLL down ; up scroll at the bottom line
cntThe number of times. Default is 1.
Return value None

Name prints
Format prints(message;str)
Function Display string.
It is similar to print the statement, this will not be able to display string only, there is no new line after display.
Argument
messagestring
Return value
NO Display correctly
YESCan't display correctly(message include control code)
Note About displaying control code, it is as same as print statement.
Or please use printCtrlCode().

Name printCtrlCode
Formatint printCtrlCode(code;int)
Function Execute display control code.
Some code is invalid in graphic coordinates mode.
Argument
codedisplay control code
Constant name Processing Code in X-BASIC/68
DISP_CTRL_CLEARLINE Clear from cursor position to end of line &h05
DISP_CTRL_BEEP Sound a beep(Equivalency beep()) &h07
DISP_CTRL_TAB TAB &h09
DISP_CTRL_LF New line &h0a
DISP_CTRL_HOME Equivalency home() &h0b
DISP_CTRL_CLS Equivalency cls() &h0c
DISP_CTRL_CR Move to below line top. Scroll up at the bottom line. &h0d
DISP_CTRL_RCR Move to upper line top. Scroll down at the top line. none
DISP_CTRL_CLEAR_EOS Clear from cursor to end of screen &h1a
DISP_CTRL_CURSOR_RIGHT cursor move to up &h1c
DISP_CTRL_CURSOR_LEFT cursor move to right &h1d
DISP_CTRL_CURSOR_UP cursor move to left &h1e
DISP_CTRL_CURSOR_DOWN cursor move to down &h1f
The italic notation disabled in graphics coordinate mode.
Return value
YESexecuted display control code
NO No control executed(Even if the specified character code is not control code).

Name inputWithPlaceholder
Format str inputWithPlaceholder(defInput;str[,placefolder;str][,keyType;int])
Function Input string.
You wait until it will be input.
Argument
defInputSpecify any string that you enter in advance.
Specify "" when you need no advance input.
placefolderString to display when there is no input.
keyTypeKeyboard type
KeyboardTypeDefault Standard
KeyboardTypeASCIICapable
KeyboardTypeAlphabet
Suitable for alphabetic input
KeyboardTypeNumbersAndPunctuation Suitable for number and punctuation input
KeyboardTypeURL Suitable for URL input
KeyboardTypeNamePhonePad same as KeyboardTypeDefault
KeyboardTypeEmailAddress Suitable for E-Mail address input
KeyboardTypeNumberPad Suitable for number input
KeyboardTypePhonePad Suitable for telephone number input
KeyboardTypeDecimalPad same as KeyboardTypeDefault
KeyboardTypeTwitter Suitable for Twitter input
The italic notation should not be specified in iPhone/iPod touch(since there is no return key).
Return value String that has been input
Note
  1. String argument given to this function must be UTF8.
  2. When you issue the this function with the cursor is at the bottom of the screen, input frame is hidden by the keyboard.
    Please note at the cursor position.

Name selectMenu
Format int selectMenu(title;str,menues();str[,cnt;int])
Function Select an item in the menu.
Wait until menu is selected.
Touch outside menu is ignored.
Argument
titleMenu Title
menuesOne dimension str array include menu items
Max 5 items. If it has two items then they are side-by-side.
If it has more than 3 items then they are arranged vertically.
The element which have "" are ignored.

cntthe number of menu items ; 1 to the number of elements
Default is the number of elements.
Return value Selected item no. (0 to 4)
Note
  • String argument given to this function must be UTF8.
  • When you call this function after touch repeated key, the key code may be stored in key buffer.
    After call this function, it is better to call kbclr().

Name selectMenuWithMessage
Format int selectMenuWithMessage(title;str,message;str,menues();str[,cnt;int])
Function Select an item in the menu.
Wait until menu is selected.
Touch outside menu is ignored.
Argument
messageString to be displayed under the title.
Put the accompany mainly.
titleMenu Title
menuesOne dimension str array include menu items
Max 5 items.
They are arranged as same as selectMenu().
cntthe number of menu items ; 1 to the number of elements
Default is the number of elements.
Return value Selected item no. (0 to 4)
Note
  • String argument given to this function must be UTF8.
  • When you call this function after touch repeated key, the key code may be stored in key buffer.
    After call this function, it is better to call kbclr().

Name selectMenu2
Format int selectMenu2(title;str,menues();str[,cnt;int][,fdisableBreak;int])
Function Select an item in the menu.
Wait until menu is selected.
It is enable to return when you touch outside the menu.
Argument
titleMenu Title
menuesOne dimension str array include menu items
Max 10 items.
The element which have "" are ignored.
Always arranged vertically.
cntthe number of menu items ; 1 to the number of elements
Default is the number of elements.
fdisableBreakWhether not to return when you touch the outside menu.
YES The touch at outside menu is ignored(default).
NO When you touch outside the menu, it will return from this menu.
Return value
0 to 9Selected item no.
-1touched outside menu(include /)
This is enable at fdisableBreak=NO.
Note
  • String argument given to this function must be UTF8.
  • When you call this function after touch repeated key, the key code may be stored in key buffer.
    After call this function, it is better to call kbclr().
  • After V3.2, unless you set fdisableBreak = NO, it does not return when you touch outside the menu.

Name logoAlert
Format int logoAlert([title;str][,message;str])
Function To set the alert message to be displayed when you tap .
Argument
titletitle string
messagesmessage string. You can be made to a new line by chr$(13).

If you omit title only, it becomes default message (version message).
If you omit message only, it becomes title only.
If you omit both, the logo tap is not effective.
Return value None
Note This function displays the message and waits for a tap of the "Close".
But the program after logoAlert() will still continue to run.
Therefore, it can not be used in applications to stop the process until the wait for your response.
For those application, please use such as hitKey() or selectMenu() and so on.
SamplelogoAlert.bas

Name versionXBiOSTextScreenFunc$
Format versionXBiOSTextScreenFunc$()
Function Return text screen function's version.
Argument None
Return value The version string of the text screen function


// Graphic functions

Graphic Screen have four screens. It is called the page.
Drawing target page is set by apage().
Display page is set by vpage().
and the graphic and text screen's display order is set by vpriority(). 

Thus, basically, graphic drawing programs is in the following order.
  1. vpage() Set display page
  2. vpriority() Set display page priority
  3. apage() Set page to draw
  4. wipe() clear page
  5. gColor() Set drawing color
  6. graphic drawing function(s)
In addition, graphic coordinate use float type value(It is not same as X-BASIC/68).
Name getScreenSize
Format int getScreenSize([gwx;int])
Function Get graphic screen width and height.
Argument
gwxwidth(number of dots). For returns a value, you must give by variable.
If you omit this, you can't get bitmap width.
Return value height(number of lines)
Samplec256.bas

Name apage
Format int apage(page;int)
Function Set graphic page (with bitmap) for drawing / setting and writing to file.
Argument
pageDrawing page
GPAGE0 Graphic Page0
GPAGE1 Graphic Page1
GPAGE2 Graphic Page2
GPAGE3 Graphic Page3
-1 Only return with current setting page (no setting)
Return value current page

Name vpage
Format int vpage(page;int)
Function Set display page
Argument
pageDisplay page
You can specify more than one page at a time corresponding bit. Non specified pages will be hidden.
B_TPAGE Text Screen
B_GPAGE0 Graphic Page0
B_GPAGE1 Graphic Page1
B_GPAGE2 Graphic Page2
B_GPAGE3 Graphic Page3
B_SPAGE Sprite and BG Screen
-1 Only return only current page setting (no setting)
Return value current page status

Name vpriority
Format int vpriority(p0;int,p1;int,p2;int,p3;int,p4;int[,p5;int])
Function Set page display priority.
The order is High p0>p1>p2>p3>p4>p5 Low.
Argument p0 to p4=page No.
TPAGEText Screen
GPAGE0 Graphic Page0
GPAGE1 Graphic Page1
GPAGE2 Graphic Page2
GPAGE3 Graphic Page3
SPAGE Sprite and BG Screen
Do not specify duplicate page number. If sprite function is disable then you must not set p5.
Return value
YESok
NO There is a duplicate set (error)

Name screenRotate
Format screenRotate(onoff;int)
Function Set whether or not to rotate the screen in accordance with the rotation of the device.
Note that resolution will change when you rotate the screen.
Argument
onoff
YESEnable to rotate
NO Disable to rotate
Return value None

Name getOrientation
Format int getOrientation()
Function Get device screen direction.
Argument None
Return value
DeviceOrientationUnknown Unknown
DeviceOrientationPortrait Portrait with home button is lower side.
DeviceOrientationPortraitUpsideDown Portrait with home button is upper side.
DeviceOrientationLandscapeLeft Landscape with screen is left
=home button is right side.
DeviceOrientationLandscapeRight Landscape with screen is right
=home button is left side.
When you put device at face-up or face-down orientation, it returns the previous direction.
Note When you ban to screen rotation by screenRotate(NO), this does not change by rotating the device.

Name lineWidth
Format lineWidth(wd;float)
Function Set line width of line/lines/box/circle/ellipse.
Argument
wd>=1.0
The line spreads on both sides from the center.
Therefore, if a horizontal line, it is drawn in the range from up +wd/2 to under -wd/2.
Return value None

Name lineCap
Format lineCap(cap;int)
Function Specifies the shape of the line at both ends.
Argument
capcap shape
LineCapButt Standard
LineCapRound Round
LineCapSquare Square
Note : This effect can not see when lineWidth is not large enough.
Return value None

Name lineJoin
Format lineJoin(join;int)
Function Specifies the shape of the coupling segment.
Argument
joinjoin shape
LineJoinMiter standard
LineJoinRound Round
LineJoinBevel2 Square
Note : This effect can not see when lineWidth is not large enough.
Return value None

Name blend/gBlend
Format blend(blend;int)
gBlend(blend;int)
Function Specifies the processing of part shapes overlap.
Argument
blendProcessing method
BlendModeNormal overwrite(normal)
BlendModeMultiply multiple
BlendModeScreen  
BlendModeOverlay  
BlendModeDarken  
BlendModeLighten  
BlendModeColorDodge  
BlendModeColorBurn  
BlendModeSoftLight  
BlendModeHardLight  
BlendModeDifference  
BlendModeExclusion  
BlendModeHue  
BlendModeSaturation  
BlendModeColor  
BlendModeLuminosity  
BlendModeClear clear
BlendModeCopy  
BlendModeSourceIn  
BlendModeSourceOut  
BlendModeSourceAtop  
BlendModeDestinationOver  
BlendModeDestinationIn  
BlendModeDestinationOut  
BlendModeDestinationAtop  
BlendModeXOR  
BlendModePlusDarker  
BlendModePlusLighter  
Return value None
SampleblendModeSample.bas

Name gAntiAlias
Format gAntiAlias(fantiAlias;int)
Function Set anti-aliasing for graphic drawing.
Argument
fantiAlias
YESenable anti-aliasing
NO disable anti-aliasing
Return value None
Note It does not matter to the bitmap drawing.

Name gColor/gcolor
Format gColor(r;int,g;int,b;int[,alpha;int])
gcolor(r;int,g;int,b;int[,alpha;int])
Function Set graphic drawing color.
Argument color component
If you set r only, it is regarded as a composite RGB value.
Example :
gColor(&hffffffff) :// highlighted white

You are able to set standard color by following constants:
CTBLACK black CTHBLACK black
CTBLUE blue CTHBLUE highlighted blue
CTRED red CTHRED highlighted red
CTMAGENTA magenta CTHMAGENTA highlighted magenta
CTGREEN green CTHGREEN highlighted green
CTCYAN cyan CTHCYAN highlighted cyan
CTYELLOW yellow CTYELLOW highlighted yellow
CTWHITE white CTHWHITE highlighted white
Example
gColor(CTHWHITE) :// highlighted white
------------------------------------------------------------------
When you specify even after g, it assumed to be specified separate RGB value.
rred-component0 to 255
ggreen-component0 to 255
bblue-component0 to 255
alphaTransparency0 to 255
default is 255
If you set r<0,g=0,b=0, then it is able to set standard color.
At this time, if you set aplha = -1, setting its own standard color.
If you set alpha value alpha >= 0 , you can change alpha value only.
You are able to set standard color by following constants:
TBLACK black THBLACK black
TBLUE blue THBLUE highlighted blue
TRED red THRED highlighted red
TMAGENTA magenta THMAGENTA highlighted magenta
TGREEN green THGREEN highlighted green
TCYAN cyan THCYAN highlighted cyan
TYELLOW yellow TYELLOW highlighted yellow
TWHITE white THWHITE highlighted white
Example
gColor(-THWHITE,0,0,255) :// highlighted white
Return value None
Note If you set alpha value not to 255, you need to set gBlend() because it will be synthesized with underlayer graphic.
Example : Clear transparent
gColor(0,0,0,0)
gBlend(BlendModeClear)

Name rgb
Format int rgb(r;int,g;int,b;int[,alpha;int])
Function Calculate composite RGB value from separate RGB value.
If you use web safe color, you omit alpha or you must set alpha to 255.
Example : #99FF66 → &h99ff66ff:// The last 'ff' is alpha value.
Argument each color component
rred-component0 to 255
ggreen-component0 to 255
bblue-component0 to 255
alphaTransparency0 to 255
default is 255
Return value composite RGB value

Name hsv
Format int hsv(h;int,s;int,v;int[,alpha;int])
Function Calculate composite RGB value from HSV colorspace value.
Argument HSV component value
hHue-component0 to 359
sSaturation-component0 to 255
vValue(Brightness)-component0 to 255
alphatransparency0 to 255
default is 255.
Return value composite RGB value

Name splitRGB
Format splitRGB(rgba;int,r;int,g;int,b;int,alpha;int)
Function Split composite RGB valueto separate RGB value.
Argument
rgbacomposite RGB value
rreturn separate red-component. You must specify a int variable.
greturn separate green-component. You must specify a int variable.
breturn separate blue-component. You must specify a int variable.
alphareturn separate transparency-component. You must specify a int variable.
Return value None

Name gborder/gBorder
Format gborder(width;float,r;int[,g;int,b;int[,alpha;int]])
gBorder(width;float,r;int[,g;int,b;int[,alpha;int]])
Function Draw a border to the graphic screen
Argument
widthborder width ; >0
r,g,b,alphaeach color component
How to specify the color component is the same as gColor().
Return value None

Name gBackgroundAlpha
Format gBackgroundAlpha(alpha;float)
Function Set the graphic screen's transparency.
Argument
alphaTransparency=0.0 to 1.0
It will lower the value, it will be more transparent.
Note you will no longer see at 0.0.
Return value None

Name gBackgroundColor
Format gBackgroundColor(r;int[,g;int,b;int[,alpha;int]])
Function Set background color of the graphics screen.
Argument
r,g,b,alphaeach color component
How to specify the color component is the same as gColor().
Return value None

Name pset
Format pset(x;float,y;float)
Function Draw dot
Argument
x,ycoordinate
Return value None

Name line
Format line(sx;float,sy;float,ex;float,ey;float[,ffill;int][,style;int])
Function Draw line
Argument
sx,systart point coordinate
ex,eyend point coordinate
ffill
YESfill inside
NO not fill(default)
styleSet line style
A place of bit=1 is drawn (16bit).
Default is &hffff.

Note:
On iOS, it must always start from the rendering.
If 0 is continuous from the most significant bit(If you start from the non-rendering), the bits are moved to the least significant bit.
Example : &h5555 (01010101 01010101) is translated to &haaaa (10101010 10101010).
Return value None

Name lines
Format lines(xys();float[,ffill;int][,style;int])
Function Connecting a line from a group of consecutive coordinates.
Argument
xysOne demension include group of coordinate
The coordinate group set necessary number pair of (x, y).
The array will be stored in the order of x1,y1,x2,y2 ... .
There are the number of elements/2 coordinate pairs in the array.
It can specify up to a maximum of 64 sets.
(+0)=x coordinate , (+1)=y coordinate
ffill
YESfill inside
NO not fill(default)
styleline style.
For detail see line() style.
Default is &hffff.
Return value None

Name box
Format box(sx;float,sy;float,ex;float,ey;float[style;int])
Function Draw rectangle
Argument
sx,systart point coordinate
ex,eyend point coordinate
styleline style.
For detail see line() style.
Default is &hffff.
Return value None

Name fill
Format fill(sx;float,sy;float,ex;float,ey;float)
Function Fill rectangle.
Argument
sx,systart point coordinate
ex,eyend point coordinate
Return value None

Name circle
Format circle(cx;float,cy;float,r;float[,startAngle;float][,endAngle;float][,clockwise;int][,ffill;int][,style;int])
Function Draw circle or arc.
Argument
cx,cycenter coordinate
r radius of the arc
startAngleThe angle to starting point of the arc. This is set to clockwise from horizontal as 0.
Default is 0.0.
If you set negative angle, it will draw fan-shaped.
endAngleThe angle to end point of the arc.
Default is pi(2).
If you set negative angle, it will draw fan-shaped.
clockwisedraw direction
0Clockwise direction(default)
1Counterclockwise direction
ffill
YESfill inside
NO not fill(default)
styleline style.
For detail see line() style.
Default is &hffff.
The relationship of clockwise, startAngle and endAngle is as follows.
(endAngle increased by pi(n/4.0)).
clockwise=0
startAngle=0.0
clockwise=1
startAngle=0.0
clockwise=0
clockwise=1
Return value None
Samplecircle.bas

Name ellipse
Format ellipse(cx;float,cy;float,r;float[,hv;float][,ffill;int][,style;int])
Function Draw ellipse.
Argument
cx,cycenter coordinate
r radius of the arc
hv flattening. Default is 1.0.
>0.0the virtical radius*hv
<0.0the horizontal radius*(-hv)
=0.0 or 1.0Both the vertical and horizontal radius=r;True circle
ffill
YESfill inside
NO not fill(default)
styleline style.
For detail see line() style.
Default is &hffff.
Return value None
Sampleellipse.bas

Name symbol
Format float symbol(sx;float,sy;float,string;str,fontName;str,pointSize;float[,ht;float])
Function Draw strings
Argument
sx,systart point coordinate
stringstring
fontNamefont name
pointSizefont size
htIf you do not omit, the drawing height is returned.
Return value Draw width
Note If it can not find the specified font, it uses the default font.
SamplegraphicTest.bas

Name symbolt
Format symbolt(sx;float,sy;float,string;str,fontName;str,pointSize;float)
Function Draw strings virticaly
Argument
sx,systart point coordinate
stringstring
fontNamefont name
pointSizefont size
Return value None
Note
  • If it can not find the specified font, it uses the default font.
  • Unlike the symbol(), this does not return drawing width.
SamplegraphicTest.bas

Name wipe
Format wipe()
Function Clear graphic screen
Argument None
Return value None

Name gScroll
Format gScroll(mode;int,cnt;int)
Function Graphic scroll
Argument
modescroll mode
SCROLL_UPup scroll
SCROLL_DOWNdown scroll
SCROLL_LEFTleft scroll
SCROLL_RIGHTright scroll
cntScroll count(lines or dots)
Return value None

Name pngSave
Format int pngSave(fname;str)
Function Graphic screen is output to a file by PNG.
Output target page is the page specified in apage().
Argument
fnamefile name
It needs to write to extension ".png".
Return value
-1 Pending(Do not know immediately after this function call because it is multi-tasking)
1 ok
0 error
SamplegraphicTest.bas

Name jpegSave
Format int jpegSave(fname;str,quality;int)
Function Graphic screen is output to a file by JPEG.
Output target page is the page specified in apage().
Argument
fnamefile name
It needs to write to extension ".jpg".
qualityQuality= 0.0 to 1.0
The higher the value, the lower the compression ratio of the image.
Return value
-1 Pending(Do not know immediately after this function call because it is multi-tasking)
1 ok
0 error
SamplegraphicTest.bas

Name imageCopyToAlbum
Format int imageCopyToAlbum(fname;str)
Function Copy the image file to the album.
In this way, you will be able to see in the "Photos".
Argument
fnamefile name
It needs to write to extension ".jpg" or ".png".
You must not specify non-image file.
Return value There is a return value tentatively, you should get by gfileStatus() basically.
-1 Pending(Do not know immediately after this function call because it is multi-tasking)
1 ok
0 error
Note If you call this function after pngSave()/jpegSave(), you must wait until gfileStatus()=1.
SamplefilecopyTest.bas

Name imgLoad
Format int imgLoad([sx;float][,sy;float][,wx;float][,wy;float],fname;str)
Function Display a image file at the specified coordinate.
Argument
sx,syDisplay start point coordinate. Default is 0.
wx,wyarea width
If the image is larger than the width will shrink.
When it is small, fit the area to expand.
When set default or wx=0 or wy=0 then use image size itself.
fnameimage file name
Supported image file format is below:
File extensionsformat
.png PNG (Portable Network Graphic)
.jpg .jpeg JPEG (Joint Photographic Extert Group)
.gif GIF (Graphic Interchange Format)
.bmp .BMPf BMP (Windows Bitmap Format)
.tif .tiff TIFF (Tagged Image File Format)
.ico Windows Icon format
.cur Windows Cursor
.xbm XWindow BitMap
Extension is necessary.
Return value
-1 Pending(Do not know immediately after this function call because it is multi-tasking)
1 ok
0 error
NoteThe png with transparent color is only enabled by 256-color or the index color of full-color converted by gimp/Photoshop.
Samplepicloader.bas,picloaderSc.bas,clock.bas,compass.bas

Name tileImgLoad
Format int tileImgLoad(sx;float,sy;float,wx;float,wy;float,fname;str)
Function Paste the image repeating in the area of specified coordinates and width.
Argument
sx,syDisplay start point coordinate. Default is 0.
wx,wyarea width
If the image is larger than the area width, it is pasted until the fit from the upper left(No scaling).
When set default or wx=0 or wy=0 then use image size itself.
fnameimage file name
This is same as imgLoad().
Return value
-1 Pending(Do not know immediately after this function call because it is multi-tasking)
1 ok
0 error
SamplegraphicTest.bas

Name gfileStatus
Format int gfileStatus()
Function Get return value of the previous pngSave()/jpegSave()/imgLoad()/tileImgLoad()/imageCopyToAlbum().
X-BASIC' is multi-tasking those functions.
So it does not know immediately after them.
Therefore, there is this function.
Argument None
Return value
-1 Pending(Do not know immediately after this function call because it is multi-tasking)
1 ok
0 error

Name bitmapOpen
Format int bitmapOpen([wx;int,wy;int][,fdirect;int])
Function Allocate bitmap graphic work area.
The bitmap is allocated with each graphic screen, and it is also exchanded by apage() with graphic screen.
Argument
wxbitmap width
0 means as same as the screen width. Default and at fdirect=YES are 0.
wybitmap height
0 means as same as the screen height. Default and at fdirect=YES are 0.
fdirect
NO Allocate bitmap
Default is NO.
YESUse the same area as the usual graphic function.
Return value
YES allocated
Always YES at fdirect.
NO disable to allocate.(BitmapClose() have not been called yet / Memory can not be allocated)
Note
  • If you use bitmap with each graphic page, you must allocate each bitmap with apage():bitmapOpen().
  • The differences in processing with the setting of fdirect and bitmap functions and usual graphics functions is below:
  • When fdirect=YES, it use iOS internal workarea. So depending on the timing, the content in the drawing, in spite of not issuing the bitmapImgLoad(), it may would have been displayed.
  • The pic_load() family and cut_load() family issue bitmapImgLoad() automatically at fdirect=OFF.
    In addition, it is converted Retina when drawing to the real screen.
SamplebitmapTest.bas,fractal16.bas

Name bitmapClose
Format bitmapClose()
Function Close bitmap
Argument None
Return value None
Note When you had use bitmap with each graphics page, you must release each bitmap with apage():bitmapClose().
SamplebitmapTest.bas,fractal16.bas

Name getBitmapSize
Format int getBitmapSize([wx;int])
Function Get bitmap width and height.
Argument
wxbitmap width. For returns a value, you must give by variable.
If you omit this, you can't get bitmap width.
Return value bitmap height

Name bitmapWipe
Format bitmapWipe()
Function Clear bitmap
Argument None
Return value None

Name bitmapPset
Format bitmapPset(x;int,y;int,r;int[,g;int,b;int,alpha;int])
Function Draw a pixel in bitmap.
Argument
xx-coordinate : 0 to wx-1
yy-coordinate : 0 to wy-1
r,g,b,alphaEach color value (0 to 255).
If you set r only, it is regarded as a composite RGB value.
Coordinates of the bitmap is specified by the int-value.
It does not drawn when out of range.
Return value None
Samplefractal16.bas

Name bitmapPoint
Format int bitmapPoint(x;int,y;int[,r;int,g;int,b;int,alpha;int])
Function Get a pixcel color value int bitmap.
Argument
xx-coordinate : 0 to wx-1
yy-coordinate : 0 to wy-1
rreturn separate red-component. You must specify a int variable.
greturn separate green-component. You must specify a int variable.
breturn separate blue-component. You must specify a int variable.
alphareturn separate transparency-component. You must specify a int variable.
Coordinates of the bitmap is specified by the int-value.
If you omitted r/g/b/alpha, it means that return value only use.
Return value Color value by conposite RGB
It returns 0 when out of range.
Samplep68-246g.bas

Name bitmapLine
Format bitmapLine(sx;int,sy;int,ex;int,ey;int,r;int[,g;int,b;int,alpha;int])
Function Draw line in bitmap.
Argument
sx,systart coordinate
ex,eyend coordinate
r,g,b,alphaEach color value (0 to 255).
If you set r only, it is regarded as a composite RGB value.
Coordinates of the bitmap is specified by the int-value.
When the coordinates are out of range, it is drawn only in the range.
Return value None
SamplebitmapTest.bas

Name bitmapBox
Format bitmapBox(sx;int,sy;int,ex;int,ey;int,r;int[,g;int,b;int,alpha;int])
Function Draw box in bitmap.
Argument
sx,systart coordinate
ex,eyend coordinate
r,g,b,alphaEach color value (0 to 255).
If you set r only, it is regarded as a composite RGB value.
Coordinates of the bitmap is specified by the int-value.
When the coordinates are out of range, it is drawn only in the range.
Return value None
SamplebitmapTest.bas

Name bitmapFill
Format bitmapFill(sx;int,sy;int,ex;int,ey;int,r;int[,g;int,b;int,alpha;int])
Function Fill box in bitmap.
Argument
sx,systart coordinate
ex,eyend coordinate
r,g,b,alphaEach color value (0 to 255).
If you set r only, it is regarded as a composite RGB value.
Coordinates of the bitmap is specified by the int-value.
When the coordinates are out of range, it is drawn only in the range.
Return value None
SamplebitmapTest.bas

Name bitmapCircle
Format bitmapCircle(x;int,y;int,rr;int,r;int[,g;int,b;int,alpha;int])
Function Draw circle in bitmap.
Argument
x,ycenter coordinate
rrradius of the circle
r,g,b,alphaEach color value (0 to 255).
If you set r only, it is regarded as a composite RGB value.
Coordinates of the bitmap is specified by the int-value.
When the coordinates are out of range, it is drawn only in the range.
Return value None
SamplebitmapTest.bas,fractal16.bas

Name bitmapEllipse
Format bitmapEllipse(x;int,y;int,rr;int,hv;int,r;int[,g;int,b;int,alpha;int])
Function Draw ellipse in bitmap.
Argument
x,ycenter coordinate
rrradius of the ellipse
hvFlat rate
It will be true circle at hv=256. When hv<256 then major axis is rr and minor axis is rr*(hv/256).
When hv>256 then minor axis is rr and major axis is (rr*256/hv).
r,g,b,alphaEach color value (0 to 255).
If you set r only, it is regarded as a composite RGB value.
Coordinates of the bitmap is specified by the int-value.
When the coordinates are out of range, it is drawn only in the range.
Return value None
Samplecircle.bas

Name bitmapEllipse2
Format bitmapEllipse2(x;int,y;int,aa;int,bb;int,r;int[,g;int,b;int,alpha;int])
Function Draw ellipse in bitmap.
Argument
x,ycenter coordinate
aaMajor axis length/2
bbMinor axis length/2
It does not have to be aa>bb necessarily.
r,g,b,alphaEach color value (0 to 255).
If you set r only, it is regarded as a composite RGB value.
Coordinates of the bitmap is specified by the int-value.
When the coordinates are out of range, it is drawn only in the range.
Return value None
Samplecircle.bas

Name bitmapPaint
Format bitmapPaint(x;int,y;int,r;int[,g;int,b;int,alpha;int])
Function Paint monochromatic area in the bitmap.
Argument
xx-coordinate : 0 to wx-1
yy-coordinate : 0 to wy-1
r,g,b,alphaEach color value (0 to 255).
If you set r only, it is regarded as a composite RGB value.
Coordinates of the bitmap is specified by the int-value.
It does not drawn when out of range.
Return value None
SamplebitmapTest.bas,fractal16.bas

Name bitmapGetSize
Format int bitmapGetSize(sx;int,sy;int,ex;int,ey;int)
Function Calculates the number of int type dimension's elements required to bitmapGet().
AQrgument
sx,systart coordinate
ex,eyend coordinate
Coordinates of the bitmap is specified by the int-value.
Whether the coordinates are out of range are not taken into account.
Return value Required the number of elements

Name bitmapGet
Format bitmapGet(sx;int,sy;int,ex;int,ey;int,buff();int)
Function Get bitmap data into array.
Argument
sx,systart coordinate
ex,eyend coordinate
buffint type one-dimension array.
The required element size is (ex-sx +1) * (ey-sy +1). You can also calculate by bitmapGetSize().
Each element value is composite RGB value.
Coordinates of the bitmap is specified by the int-value.
It does not get when out of range.
Return value None
Samplefractal16.bas

Name bitmapPut
Format bitmapPut(sx;int,sy;int,ex;int,ey;int,buff();int)
Function Put bitmap data from array.
Basically, you use this with bitmapGet().
Argument
sx,systart coordinate
ex,eyend coordinate
buffint type one-dimension array
Coordinates of the bitmap is specified by the int-value.
It does not put when out of range.
Return value None
Samplefractal16.bas

Name bitmapPattern
Format bitmapPattern(sx;int,sy;int,wx;int,wy;int,ptrn();int)
Function Draw bitmap pattern in array.
Argument
sx,systart coordinate
wx,wythe size of pattern data
buffint type one-dimension array
The number of elements is wx*wy, and each element value is composite RGB value
(as same as iOS type sprite pattern).
You can also give the data which is get by bitmapGet().
Coordinates of the bitmap is specified by the int-value.
It does not put when out of range.
Return value None
SampleAcode.bas,rs.bas

Name bitmapImgLoad
Format bitmapImgLoad([sx;float,sy;float,wx;float,wy;float])
Function Display a bitmap at the specified coordinate.
Argument
sx,syscreen start point coordinate
Default is (0,0).
wx,wyarea width
If the bitmap is larger than the width will shrink.
When it is small, fit the area to expand.
When set wx=0 or wy=0 then use bitmap size itself.
Deafult is wx=0 and wy=0.
When you set bitmapOpen (fdirect=YES), all argument are default.
Return value None
SamplebitmapTest.bas,fractal16.bas

Name bitmapTileImgLoad
Format bitmapTileImgLoad(sx;float,sy;float,wx;float,wy;float)
Function Paste the bitmap repeating in the area of specified coordinates and width.
When you set bitmapOpen (fdirect=YES), this function is invalid.
Argument
sx,syscreen start point coordinate
Default is (0,0).
wx,wyarea width
If the bitmap is larger than the area width, it is pasted until the fit from the upper left(No scaling).
When set wx=0 or wy=0 then use bitmap size itself.
Deafult is wx=0 and wy=0.
Return value None
SamplebitmapTest.bas,fractal16.bas

Name picLoader/pic_load
Format int picLoader(sx;float,sy;float,fname;str[,fdirect;int][,fNoBitmapClose;int])
int pic_load(sx;float,sy;float,fname;str[,fdirect;int][,fNoBitmapClose;int])
Function Display a X68000's PIC file at the specified coordinate.
When the image is possible to display in the screen, it is displayed with original size. If the image size is exceed the screen size, it is reduced within screen.
Argument
sx,syscreen start point coordinate
This is not related to whether the image size exceed the screen size.
fnameX68000's PIC file name
Extension is necessary.
Supported PIC file is 32768 colors format only.
fdirect
NO Allocate bitmap
Default is NO.
YESUse the same area as the usual graphic function.
If sx<>0 or sx<>0 then fdirect=NO.
fNoBitmapClose
YESDon't issue bitmapClose() at end of function. As this, you will use image data after this function.
When you are finished using, calling the bitmapClose().
NOIssue bitmapClose() at end of function(default)
Return value
=0 ok
<>0 error (file not found/bitmap is already used/not supported format file/and so on)
Note
  • This function uses bitmap except fdirect=YES.
    So it occurs an error if you are using bitmap elsewhere.
  • Aspect ratio is not converted. Since iOS is a square dot, it looks a little portrait.
    (X68000 is horizontal:vertical = 4:3.)
    If you want to convert of aspect ratio on the display, please use gTransform().
  • The display result may be slightly different whether fdirect is YES or NO.
  • When fdirect=YES, it can not display image region exceeding the screen width and height (it is ignored with internal data).
Samplepicloader.bas,picloaderSc.bas

Name picHeader
Format int picHeader(fname;str[,comment;str][,fsquare;int][,mode;int][,bitLength;int][,wx;int][,wy;int])
Function Read X68000's PIC file header information.
About header information is here and here (Japanese only).
Argument
fnameX68000's PIC file name
Extension is necessary.
commentcomment. You must specify a str variable to return the contents.
The character code &h1a in comment is converted to '/'.
Parts that do not fit into a string variable is cut off.
The character code in comment string is SHIFT-JIS( or ASCII).
fsquareReturn image aspect ratio information. You must specify a variable to return the contents.
NO Not square pic(Aspect ratio 4:3)
YESSquare pic (Aspect ratio 1:1)
mode mode. You must specify a variable to return the contents.
bitLength Bit length of color. You must specify a variable to return the contents.
The picLoader() can display only bitLength=15 image.
wx image width. You must specify a variable to return the contents.
wy image height. You must specify a variable to return the contents.
Return value
=0 ok
<>0 error (file not found and so on)
SamplegraphHeader.bas,picloaderSc.bas

Name cutLoader/cut_load
Format int cutLoader(sx;float,sy;float,fname;str[,fdirect;int][,fNoBitmapClose;int])
int cut_load(sx;float,sy;float,fname;str[,fdirect;int][,fNoBitmapClose;int])
Function Display a X68000's CUT file at the specified coordinate.
When the image is possible to display in the screen, it is displayed with original size. If the image size is exceed the screen size, it is reduced within screen.
Argument
sx,syscreen start point coordinate
This is not related to whether the image size exceed the screen size.
fnameX68000's CUT file name
Extension is necessary.
fdirect
NO Allocate bitmap
Default is NO.
YESUse the same area as the usual graphic function.
If sx<>0 or sx<>0 then fdirect=NO.
fNoBitmapClose
YESDon't issue bitmapClose() at end of function. As this, you will use image data after this function.
When you are finished using, calling the bitmapClose().
NOIssue bitmapClose() at end of function(default)
Return value
=0 ok
<>0 error (file not found/bitmap is already used/not supported format file/and so on)
Note
  • This function uses bitmap except fdirect=YES.
    So it occurs an error if you are using bitmap elsewhere.
  • Aspect ratio is not converted.
  • The display result may be slightly different whether fdirect is YES or NO.
  • When fdirect=YES, it can not display image region exceeding the screen width and height (it is ignored with internal data).
Samplepicloader.bas,picloaderSc.bas

Name cutHeader
Format int cutHeader(fname;str[,wx;int][,wy;int])
Function Read X68000's CUT file header information.
Argument
fnameX68000's CUT file name
Extension is necessary.
wx image width. You must specify a variable to return the contents.
wy image height. You must specify a variable to return the contents.
Return value
=0 ok
<>0 error (file not found and so on)
SamplegraphHeader.bas,picloaderSc.bas

Name magLoader
Format int magLoader(sx;float,sy;float,fname;str[,fdirect;int][,fNoBitmapClose;int])
Function Display a MAG file at the specified coordinate.
When the image is possible to display in the screen, it is displayed with original size. If the image size is exceed the screen size, it is reduced within screen.
Argument
sx,syscreen start point coordinate
This is not related to whether the image size exceed the screen size.
fnameMAG file name
Extension is necessary.
fdirect
NO Allocate bitmap
Default is NO.
YESUse the same area as the usual graphic function.
If sx<>0 or sx<>0 then fdirect=NO.
fNoBitmapClose
YESDon't issue bitmapClose() at end of function. As this, you will use image data after this function.
When you are finished using, calling the bitmapClose().
NOIssue bitmapClose() at end of function(default)
Return value
=0 ok
<>0 error (file not found/bitmap is already used/not supported format file/and so on)
Note
  • This function uses bitmap except fdirect=YES.
    So it occurs an error if you are using bitmap elsewhere.
  • Aspect ratio is not converted.
  • The display result may be slightly different whether fdirect is YES or NO.
  • MAKI format, 200 line image, and except analog 16/256color MAG file can not display.
  • When fdirect=YES, it can not display image region exceeding the screen width and height (it is ignored with internal data).
Samplepicloader.bas,picloaderSc.bas

Name magHeader
Format int magHeader(fname;str[,comment;str][,wx;int][,wy;int][,mode;int][,machine;str][username;str])
Function Read MAG file header information.
About header information is here (Japanese only).
Argument
fnameMAG file name
Extension is necessary.
commentcomment. You must specify a str variable to return the contents.
Parts that do not fit into a string variable is cut off.
wx image width. You must specify a variable to return the contents.
wy image height. You must specify a variable to return the contents.
mode Screen mode. You must specify a variable to return the contents.
machine Machine name. 4bytes string. You must specify a variable to return the contents.
username Username. 18bytes string. You must specify a variable to return the contents.
The character code in the comment, machinename and username is SHIFT-JIS(or ASCII).
Return value
=0 ok
<>0 error (file not found and so on)
SamplegraphHeader.bas,picloaderSc.bas

Name jpegHeader
Format int jpegHeader(fname;str[,wx;int][,wy;int])
Function Read JPEG file header information.
Argument
fnameJPEG file name
Extension is necessary.
wx image width. You must specify a variable to return the contents.
wy image height. You must specify a variable to return the contents.
Return value
=0 ok
<>0 error (file not found and so on)
SamplegraphHeader.bas,picloaderSc.bas

Name pngHeader
Format int pngHeader(fname;str[,wx;int][,wy;int][,bitLength;int])
Function Read PNG file header information.
Argument
fnamePNG file name
Extension is necessary.
wx image width. You must specify a variable to return the contents.
wy image height. You must specify a variable to return the contents.
bitLength Bit length of color. You must specify a variable to return the contents.
Return value
=0 ok
<>0 error (file not found and so on)
SamplegraphHeader.bas,picloaderSc.bas

Name gifHeader
Format int gifHeader(fname;str[,wx;int][,wy;int])
Function Read GIF file header information.
Argument
fnameGIF file name
Extension is necessary.
wx image width. You must specify a variable to return the contents.
wy image height. You must specify a variable to return the contents.
Return value
=0 ok
<>0 error (file not found and so on)
SamplegraphHeader.bas,picloaderSc.bas

Name bmpHeader
Format int bmpHeader(fname;str[,wx;int][,wy;int][,bitLength;int])
Function Read BMP file header information.
Argument
fnameBMP file name
Extension is necessary.
wx image width. You must specify a variable to return the contents.
wy image height. You must specify a variable to return the contents.
bitLength Bit length of color. You must specify a variable to return the contents.
Return value
=0 ok
<>0 error (file not found and so on)
SamplegraphHeader.bas,picloaderSc.bas

Name bitmapImageFile
Format bitmapImageFile(fname;str[,sx;int][,sy;int][,ex;int][,ey;int])
Function Load image file to bitmap.
Even when reading the PIC / CUT / MAG image file, it does not issue bitmapOpen() automatically.
Argument
fnameimage file name
Supported image file format is below:
File extensionsformat
.png PNG (Portable Network Graphic)
.jpg .jpeg JPEG (Joint Photographic Extert Group)
.gif GIF (Graphic Interchange Format)
.bmp .BMPf BMP (Windows Bitmap Format)
.tif .tiff TIFF (Tagged Image File Format)
.ico Windows Icon format
.cur Windows Cursor
.xbm XWindow BitMap
.pic X68000 PIC file
.cut X68000 CUT file
.mag MAG file
Extension is necessary.
sx,syCoordinate of start to load
Default is (0,0)
Invalid at PIC/CUT/MAG file.
ex,eyCoordinate of end to load
Default is bitmap size or image file size.
Invalid at PIC/CUT/MAG file.

The reduced conditions of PIC/CUT/MAG are the same as each loader.
In other formats, if you set all 0 to sx, sy, ex, and ey, the image file is reduced.
Return value
0 OK
>0 Error
File not found//Work can not allocate. and so on.
Note
  • The portion exceeding the image width and height set by bitmapOpen() is ignored.
Samplefractal16.bas

Name gAnimationParameter
Format gAnimationParameter([tx;float][,ty;float][,scaleX;float][,scaleY;float][,angle;float][,axis;int])
Function Simply set the parameters of gAnimation(ANIMATION_LAYER).
Argument
tx x-direction moving amount. Default is 0.
ty y-direction moving amount. Default is 0.
scaleX x-direction scale. Default is 1.0. <1.0 is scale down.
scaleY y-direction scale. Default is 1.0. <1.0 is scale down.
angle Rotation angle(Radian unit). Default is 0.
axis Rotation axis.
AXIS_X x-axis
AXIS_Y y-axis
AXIS_Z z-axis
AXIS_NONEaxis none
Default is if angle is omitted then AXIS_NONE else AXIS_X.
Return value None
Example
Movement gAnimationParameter(tx,ty,1.0,1.0,0,AXIS_NONE)
Scaling gAnimationParameter(0,0,scaleX,scaleY,0,AXIS_NONE)
Rotation gAnimationParameter(0,0,1.0,1.0,angle,AXIS_X)

Name gAnimationMatrix
Format gAnimationMatrix([m11;float][,m12;float][,m13;float][,m21;float][,m22;float][,m23;float][,m31;float][,m32;float][,m33;float][,tx;float][,ty;float])
Function Set the detail parameters (in the transformation matrix) of gAnimation(ANIMATION_LAYER).
Argument
m11,m12,m13
m21,m22,m23
m31,m32,m33
Each element of the transformation matrix
tx x-direction moving amount. Default is 0.
ty y-direction moving amount. Default is 0.
Relationship of the determinant and the argument is as follows:
General formula x-axis rotation y-axis rotation z-axis rotation
Return value None

Name gAnimation
Format gAnimation(mode;int[,duration;float][,repeatCount;float][,autoreverses;int][,animationCurve;float])
Function Execute graphics animation.
Argument
mode Animation mode
ANIMATION_STOP Stop animation
ANIMATION_LAYER Execute layer animation.
Parameters must be set up in gAnimationParameter() or gAnimationMatrix() in advance.
ANIMATION_FLIPFROMLEFT Flip from left
ANIMATION_FLIPFROMRIGHTFlip from right
ANIMATION_CURLUP Curl up
ANIMATION_CURLDOWN Curl down
duration Total execution time of one time(second). Default means mode is ANIMATION_STOP.
repeatCount The number of repeat. Default is 1.
autoreverses Whether to repeat. YES=repeat , NO=one time only(default)
animationCurve Animation speed curve
ANIMATIONCURVE_ERASEINOUT Begin slowly, accelerate through the middle of its duration, and then slow again before completing.
ANIMATIONCURVE_ERASEIN Begin slowly, and then speed up as it progresses.
ANIMATIONCURVE_ERASEOUTBegin quickly, and then slow down as it completes.
ANIMATIONCURVE_LINEAR Animation to occur evenly over its duration.
Default is ANIMATIONCURVE_ERASEINOUT.
Return value None
Note
  • This function execute in a multitasking. If you need, please implement the wait process.
  • The gAnimation() can be executed as the same time within each page.
    But depending on the setting, since the display between pages is interfered, it may not be a result of the forecast.
SamplepicloaderSc.bas,gonbe1.bas

Name gTransform
Format gTransform([tx;float][,ty;float][,scaleX;float][,scaleY;float][apage;int][,angle:float])
Function Transform the graphics screen
Argument
tx x-direction moving amount. Default is 0.
ty y-direction moving amount. Default is 0.
scaleX x-direction scale. Default is 1.0. <1.0 is scale down.
scaleY y-direction scale. Default is 1.0. <1.0 is scale down.
apage Specify the graphics page to be transform.
This is same as apage() argument.
Default is current page.
angle Rotation angle(Radian unit). Default is 0.
If you omit all argument except apage, the transform is cancelled.
Return value None
Note
  • The transform is able to set for each graphics page.
  • The gAnimation() is also originated from the result of gTransform().
  • The gTransform() is not to transform the image, it will transform the screen. At the scaling up, virtual screen is also scaling up, and the actual display is set to center of screen.
    At the scaling down, it seems as same.
    Therefore, if you do not move the coordinate, apparent display coordinates is shifted also.
  • If you set scaling factor, the screen size is changed but internal size does not change (bitmap is allocated with internal size).
  • When you publish gTransform() in a short period of time, the screen display will be jittery.
    If possible, it is better to use gAnimation().
Attention The argument order of the angle is different from the gAnimationParameter().
Samplecompass.bas,picloaderSc.bas,c13down.bas,cAcordion.bas

Name versionXBiOSGraphic$
Format versionXBiOSGraphic$()
Function Return graphic function's version.
Argument None
Return value The version string of the graphic function


// Sprite and BG functions

X-BASIC' has sprite/BG(background) screen functions.
The specification is described at here.
If you want to use these sprite functions, you must set Sprite functions to ON in Settings.
Name sp_init
Format int sp_init()
Function Initialize sprite and BG.
Initialize item are as follows:
  • Hide sprite screen.
  • Clear all patterns.
  • Initalize all scroll register.
  • Initialize all pallet blocks.
Argument None
Return value always 0

Name sp_disp
Format int sp_disp(onoff;int)
Function Control display process for sprite and BG screen.
Argument
onoff
YESdisplay
NO not display
Return value always 0
Note
  • vpage() controls to display of sprite and BG screen itself, sp_disp() controls to display of the real contents.
  • This function is controlled with sp_halt().

Name sp_clr
Format int sp_clr([sp1;int][,sp2;int])
Function Clear sprite patterns.
The pattern will be iOS type. And all dot are transparence(=0).
This clears pattern only, scroll registers is not changed.
Argument
sp1start pattern number0 to 511
Default value is 0
sp2end pattern number 0 to 511
Default value is sp1.
When sp1 is also omitted, delault value is 511.
Return value always 0
Note This function is controlled with sp_halt().

Name sp_on
Format int sp_on([pl1;int][,pl2;int][prw;int])
Function Display sprite planes
Argument
pl1start plane number 0 to 255
Default value is 0.
pl2end plane number 0 to 255
Default value is pl1.
When pl1 is also omitted, delault value is 255.
prwdisplay priority
SPRITE_PRW_HIDE hide
SPRITE_PRW_BG0BG1SPBG0>BG1>sprite
SPRITE_PRW_BG0SPBG1BG0>sprite>BG1
SPRITE_PRW_SPBG0BG1sprite>BG0>BG1(default)
Return value always 0
Note This function is controlled with sp_halt().

Name sp_off
Format int sp_off([pl1;int][,pl2;int])
Function Hide plane
Argument
pl1start plane number 0 to 255
Default value is 0.
pl2end plane number 0 to 255
Default value is pl1.
When pl1 is also omitted, delault value is 255.
Return value always 0
Note This function is controlled with sp_halt().

Name sp_halt
Format int sp_halt(onoff;int)
Function Halt the display update of sprite and BG.
When you change a large amount of the sprite display attribute (such as coordinate or pattern) at a time, process is very heavy and screen is flickered. You will use sp_halt(), it will be speed up and flicker is eliminated.
Argument
onoff
YEShalt the display processing
NOimmediately display
At this time, update display.
Return value always 0

Name sp_def
Format int sp_def(sp;int,ptn();int or char[,sz;int])
Function Set sprite pattern
Argument
sppattern number0 to 511
ptnOne dimension int or char array include pattern data Each element value is follows, and the relationship of the dot position and the element number is here.
If you will set the iOS type so you need to give by int array.
And if you will set the X68 type so you need to give by char array.
szIt exists to take the X68 compatible, but it is meaningless in the iOS version.
Return value always 0
Note This function is controlled with sp_halt().

Name sp_pat
Format int sp_pat(sp;int,ptn();int or char)
Function Read sprite pattern
Argument
sppattern number0 to 511
ptnOne demension array for reading pattern data The number of elements is need over 256. Each element value is according to sp_def().
X68 type pattern can be read also in int array, but if you specify a char array to iOS type, it is an error.
Return value Pattern type
0(SPRITE_IOS)iOS type
1(SPRITE_X68)X68 type
-1Error ; You had specify a char array to iOS type pattern reading.

Name sp_color
Format int sp_color(p;int,col;int[,pb;int])
Function Define pallet block.
Argument
p pallet code 0 to 15
Basically, Don't change pallet 0 (it is fixed to transparency).
colcolor composite RGB value
pb pallet block number 1 to 31
Default is 1.
0 can not use.
Return value Color(composite RGB value) before changing
Note This function is controlled with sp_halt().

Name sp_move
Format int sp_move(pl;int[,x;int][,y;int][,sp;int])
Function Set sprite pattern to plane and set displaying coordinate. And display it.
Argument
pl plane number 0 to 255
x,ycoordinate Freely in int range (negative to over the screen width)
If omitted, the coordinate is not changed (initial is x,y=0,0).
sp pattern number 0 to 511
If omitted, pattern number is not changed (initial is 0).
Return value always 0
Note
  • If the pattern is X68 type then it use pallet block 1 always.
    Flip none and display priority is sprite>BG0>BG1.
  • This function is controlled with sp_halt().

Name sp_setting
Format int sp_setting(pl;int[,x;int][,y;int][,sp;int][,pb:int][,flip;int][,prw;int])
Function Set sprite pattern to plane and set displaying coordinate.
It can set finer than sp_move().
Argument
pl Plane number 0 to 255
x,yCoordinate Freely in int range (negative to over the screen width)
Default, the coordinate is not changed (initial is x,y=0,0).
sp Pattern number 0 to 511
Default, pattern number is not changed (initial is 0).
pb Palette block number 1 to 31
Default is 1.
0 can not use.
If the pattern is iOS type then this argument is ignored always.
flip Flip
SPRITE_FLIP_NONE Non flip(default)
SPRITE_FLIP_HORIZONTAL Flip horizontal
SPRITE_FLIP_VERTICAL Flip vertical
SPRITE_FLIP_HORIZONTAL_VERTICALFlip horizontal and vertical
prwdisplay priority
SPRITE_PRW_HIDE hide
SPRITE_PRW_BG0BG1SPBG0>BG1>sprite
SPRITE_PRW_BG0SPBG1BG0>sprite>BG1
SPRITE_PRW_SPBG0BG1sprite>BG0>BG1(default)
Return value always 0
Note This function is controlled with sp_halt().

Name sp_stat
Format int sp_stat(pl;int,dt;int)
Function Get sprite status
Argument
plplane number0 to 255
dtdata type
0x-coordinate
1y-coordinate
2Pattern number
3Display priority
4Flip
5Palette block number
Return value By data type

Name sp_disableBG0SPBG1
Format int sp_disableBG0SPBG1(onoff;int)
Function Disable display priority BG0>SP>BG1.
If you set so, it is regarded to BG0>BG1>SP, BG0>SP(BG1 is not displayed) or SP>BG1(BG0 is not displayed).
By this is specified and when you display both BG0 and BG1, the BG work area size becomes 1/3.
Argument
onoff
YESset disable
NOset enable
Return value always 0
Note This function is controlled with sp_halt().

Name sp_image
Format int sp_image(fname;str[,ofstx;int][,ofst;int][,pwx;int][,pwy;int][,tsp;int][,tpl;int][,sx;int][,sy;int][,prw;int][fblack;int])
Function Set sprite pattern with image file.
All patterns are registerd in iOS type.
Argument
fnameimage file name Supported image file format is below:
File extensionsformat
.png PNG (Portable Network Graphic)
.jpg .jpeg JPEG (Joint Photographic Extert Group)
.gif GIF (Graphic Interchange Format)
.bmp .BMPf BMP (Windows Bitmap Format)
.tif .tiff TIFF (Tagged Image File Format)
.ico Windows Icon format
.cur Windows Cursor
.xbm XWindow BitMap
Extension is necessary.
Image size must be over 16*16.
ofstx,ofstyStart reading from the position (ofstx, ofsty) of the image.
Default is 0(both).
pwxnumber of horizontal patterns Adjust pwx * 16 not to exceed the number of dots of image.
Default or if pwx = 0 then it set to fit the image width.
You must specify a int variable to return correct value.
pwynumber of vertical patterns Adjust pwy * 16 not to exceed the number of lines of image.
Default or if pwy = 0 then it set to fit the image height.
You must specify a int variable to return correct value.
tspPattern number to start registration0 to 511
tplPlane number to start registration0 to 255
If you specify this, it does the registration to the continuous planes at the same time.
If omitted, do not register for planes.
Display priority is set by prw. Flip is SPRITE_FLIP_NONE fixed.
If it exceeds the number of maximum planes, it will be terminated.
sx,sytop (=tpl) pattern's coordinate Freely in int range (negative to over the screen width)
Default, the coordinate is not changed (initial is x,y=0,0).
Coordinates of the 2nd later pattern are automatically set to line up in the same way as the original image.
prwdisplay priority
SPRITE_PRW_HIDE hide
SPRITE_PRW_BG0BG1SPBG0>BG1>sprite
SPRITE_PRW_BG0SPBG1BG0>sprite>BG1
SPRITE_PRW_SPBG0BG1sprite>BG0>BG1(default)
fblackWhether to convert black color to transparent within the image.
YES convert(Defalt)
NO not convert

Pattern will be registered in the order from upper left to lower right.
It must betsp*pwx*pwy<=511. Part in exceed is not registered.
Return value
>=tsp+1 Registered last pattern number+1
<0 Error
File is not found/Work can not allocate. and so on.
Note This function is controlled with sp_halt().

Name bg_fill
Format int bg_fill(pg;int,sp;int[,pb;int][,flip;int])
Function Fill up the BG text page with a pattern.
Argument
pg BG text page number 0/1
sp pattern number 0 to 511
pb pallet block number 1 to 31
Default is 1.
0 can not use.
If the pattern is iOS type then this argument is ignored always.
flip Flip
SPRITE_FLIP_NONE Non flip(default)
SPRITE_FLIP_HORIZONTAL Flip horizontal
SPRITE_FLIP_VERTICAL Flip vertical
SPRITE_FLIP_HORIZONTAL_VERTICALFlip horizontal and vertical
Return value always 0
Note This function is controlled with sp_halt().

Name bg_put
Format int bg_put(pg;int,x;int,y;int,sp;int[,pb;int][,flip;int])
Function Set a pattern with the coordinate of specified BG text page.
Argument
pg BG text page number 0/1
x,yBG text page coordinate0 to 127 both x and y
sp Pattern number 0 to 511
pb Palette block number 1 to 31
Default is 1.
0 can not use.
If the pattern is iOS type then this argument is ignored always.
flip Flip
SPRITE_FLIP_NONE Non flip(default)
SPRITE_FLIP_HORIZONTAL Flip horizontal
SPRITE_FLIP_VERTICAL Flip vertical
SPRITE_FLIP_HORIZONTAL_VERTICAL Flip horizontal and vertical
Return value always 0
Note This function is controlled with sp_halt().

Name bg_get
Format int bg_get(pg;int,x;int,y;int[,pb;int][,flip;int])
Function Get a pattern number with the coordinate of specified BG text page.
Argument
pg BG text page number 0/1
x,y BG text page coordinate0 to 127 both x and y
pb Palet block number For returns a value, you must give by variable.
flipFlip For returns a value, you must give by variable.
Return value pattern number

Name bg_set
Format int bg_set(scrnNo;int,pg;int,fdisp;int)
Function Register BG text page to BG screen and set display status.
Argument
scrnNo BG screen number 0/1
pg BG text page number0/1
fdisp display flag
NOhide
YESdisplay
Return value always 0
Note This function is controlled with sp_halt().

Name bg_scroll
Format int bg_scroll(scrnNo;int[,x;int][,y;int])
Function Set display coordinate for BG screen.
Argument
scrnNoBG screen number 0/1
x,ycoordinate Freely in int range (negative to over the screen width)
Default, the coordinate is not changed (initial is x,y=0,0).
Return value always 0
Note This function is controlled with sp_halt().

Name bg_stat
Format int bg_stat(scrnNo;int,dt;int)
Function Get BG status.
Argument
scrnNoBG screen number0/1
dt data type
0display x-coordinate
1display y-coordinate
2BG text page number
3display flag
Return value By data type

Name spAnimationParameter
Format spAnimationParameter([tx;float][,ty;float][,scaleX;float][,scaleY;float][,angle;float][,axis;int])
Function Simply set the parameters of spAnimation(ANIMATION_LAYER).
Argument
tx x-direction moving amount. Default is 0.
ty y-direction moving amount. Default is 0.
scaleX x-direction scale. Default is 1.0. <1.0 is scale down.
scaleY y-direction scale. Default is 1.0. <1.0 is scale down.
angle Rotation angle(Radian unit). Default is 0.
axis Rotation axis. Default is if angle is omitted then AXIS_NONE else AXIS_X.
Return value None
Example
Movement spAnimationParameter(tx,ty,1.0,1.0,0,AXIS_NONE)
Scaling spAnimationParameter(0,0,scaleX,scaleY,0,AXIS_NONE)
Rotation spAnimationParameter(0,0,1.0,1.0,angle,axis)

Name spAnimationMatrix
Format spAnimationMatrix([m11;float][,m12;float][,m13;float][,m21;float][,m22;float][,m23;float][,m31;float][,m32;float][,m33;float][,tx;float][,ty;float])
Function Set the detail parameters (in the transformation matrix) of spAnimation(ANIMATION_LAYER).
Argument
m11,m12,m13
m21,m22,m23
m31,m32,m33
Each element of the transformation matrix
tx x-direction moving amount. Default is 0.
ty y-direction moving amount. Default is 0.
Relationship of the determinant and the argument is as follows:
General formula x-axis rotation y-axis rotation z-axis rotation
Return value None

Name spAnimation
Format spAnimation(mode;int[,duration;float][,repeatCount;float][,autoreverses;int][,animationCurve;float])
Function Execute sprite and BG animation.
Argument
mode Animation mode
ANIMATION_STOP Stop animation
ANIMATION_LAYER Execute layer animation.
Parameters must be set up in gAnimationParameter() or gAnimationMatrix() in advance.
ANIMATION_FLIPFROMLEFT Flip from left
ANIMATION_FLIPFROMRIGHTFlip from right
ANIMATION_CURLUP Curl up
ANIMATION_CURLDOWN Curl down
duration Total execution time of one time(second). Default means mode is ANIMATION_STOP.
repeatCount The number of repeat. Default is 1.
autoreverses Whether to repeat. YES=repeat , NO=one time only(default)
animationCurve Animation speed curve
ANIMATIONCURVE_ERASEINOUT Begin slowly, accelerate through the middle of its duration, and then slow again before completing.
ANIMATIONCURVE_ERASEIN Begin slowly, and then speed up as it progresses.
ANIMATIONCURVE_ERASEOUT Begin quickly, and then slow down as it completes.
ANIMATIONCURVE_LINEAR Animation to occur evenly over its duration.
Default is ANIMATIONCURVE_ERASEINOUT.
Return value None
Note The spAnimation() can be executed at the same time as aAnimation(). But depending on the setting, since the display between pages is interfered, it may not be a result of the forecast.

Name spTransform
Format spTransform([tx;float][,ty;float][,scaleX;float][,scaleY;float])
Function Transform the sprite and BG screen
Argument
tx x-direction moving amount. Default is 0.
ty y-direction moving amount. Default is 0.
scaleX x-direction scale. Default is 1.0. <1.0 is scale down.
scaleY y-direction scale. Default is 1.0. <1.0 is scale down.
Return value None
Note
  • The spAnimation() is also originated from the result of spTransform().
  • The spTransform() is not to transform the image, it will transform the screen. At the scaling up, virtual screen is also scaling up, and the actual display is set to center of screen.
    At the scaling down, it seems as same.
    Therefore, if you do not move the coordinate, apparent display coordinates is shifted also.
  • Rotation is disable.

Name sborder/sBorder
Format sborder(width;float,r;int[,g;int,b;int[,alpha;int]])
sBorder(width;float,r;int[,g;int,b;int[,alpha;int]])
Function Draw a border to the sprite screen
Argument
widthborder width ; >0
r,g,b,alphaeach color component
How to specify the color component is the same as tColor().
Return value None

Name sBackgroundAlpha
Format sBackgroundAlpha(alpha;float)
Function Set transparency all of the sprite and BG screen.
Argument
alphaTransparency=0.0 to 1.0
It will lower the value, it will be more transparent.
Note you will no longer see at 0.0.
Return value None

Name sBackgroundColor
Format sBackgroundColor(r;int[,g;int,b;int[,alpha;int]])
Function Set background color of the sprite screen.
Argument
r,g,b,alphaeach color component
How to specify the color component is the same as tColor().
Return value None

Name versionXBiOSSprite$
Format versionXBiOSSprite$()
Function Return sprite and BG function's version.
Argument None
Return value The version string of the sprite and BG function


// Touch and Key input functions

Key functions of the X-BASIC' are two main types.
One is "Area touch", set the touch area on the screen at any position, 
and return a key code when there is touched.
The other is "Function-key", displays the string at the bottom of the screen, 
and return a key code when you touch it.

Both keys so accumulated in the internal buffer when pressed, 
you read it when necessary.

Screen to display the function-key is independent to graphic and text screen.
So itt is not necessary to consider the overlay with them.
(The priority is always on top.)

Key input by Area touch is repeat.
Function-key is not repeat.
Name inkey
Format int inkey()
Function Reads keystrokes(Equivalent to real-time input key).
Argument None
Return value character code
Returns 0 if there is nothing press.

Name inkey$
Format str inkey$()
Function Reads keystrokes with string(Equivalent to real-time input key).
Argument None
Return value character string
Returns NULL$("") if there is nothing press.

Name kbhit/keysns
Format int kbhit()
int keysns()
Function Check whether there was a key input.
Argument None
Return value
YESThere is an(or some) input(s)
NO key input is none

Name kbclr
Format kbclr()
Function Clear keyboard buffer.
Argument None
Return value None

Name keyRepeatTime
Format keyRepeatTime(r1;float,r2;float)
Function Set the key repeat interval time when you hold down the touch area that you will set by setTouchArea() or setTouchAreaWithText().
Argument
r1Time until the start of the repeat
200+r1*100 ms
r1<0 means repeat disable.
r2Repeat interval
30+5*r2 ms
r2<0 means repeat starts immediately.
Standard value are r1=3 and r2=2.
Return value None
Note keyRepeatTime() itself does not set repeat time.
The actual setting of the repeat time is performed by setTouchArea()/setTouchAreaWithText() with the values set in this.
SampletouchTest.bas

Name setTouchArea
Format int setTouchArea(sx;float,sy;float,wx;float,wy;float,keyCode;int,fBeganOnly;int[,r;int[,g;int,b;int[,alpha;int]]])
Function Set touch area with graphic coordinate.
Argument
sx,syArea start point coordinate(graphic coordinate)
wx,wyArea width
keyCodeKey code to return when you press in this touch-area.
Get key code by inkey() or inkey$() when touch-area is touched.
fBeganOnly
YESIt only respond when you touch within the area.
NO To respond when you came into the area from outside the area.
backColor Specifies the color in a state in which the touch area is not pressed.
If you set r only, it is regarded as a composite RGB.
rred-component0 to 255
ggreen-component0 to 255
bblue-component0 to 255
alphaTransparency0 to 255(Default is 255)
On the screen, touch screen is always the top priority,
it is displayed on top of the text and graphics.
Please set the color to consider it.
Return value Touch area No.
If you need to remove, that you keep this value.
Note
  • Simultaneously pressing more than one area does not support.
  • Area set does not change even if the screen rotation.
  • There is no upper limit on the number of area settings.
SampletouchTest.bas

Name setTouchAreaWithText
Format int setTouchAreaWithText(sx;int,sy;int,wx;int,wy;int,keyCode;int,fBeganOnly;int[,r;int[,g;int,b;int[,alpha;int]]])
Function Set touch area with text coordinate.
Argument
sx,syArea start point coordinate(text coordinate)
wx,wyArea width
keyCodeKey code to return when you press in this touch-area.
Get key code by inkey() or inkey$() when touch-area is touched.
fBeganOnly
YESIt only respond when you touch within the area.
NO To respond when you came into the area from outside the area.
backColor Specifies the color in a state in which the touch area is not pressed.
Set as same as setTouchAreaWith().
Return value Touch area No.
If you need to remove, that you keep this value.

Name removeTouchArea
Format removeTouchArea(no;int)
Function Release the touch area of the specified number.
Argument
noTouch area No.
setTouchArea()'s return value
Return value None
Note If you call this, touch reverse animation is stopped. So you must not call this immediately after touch.
Reference Please Check whether the touch area No. is correct when the area is not released.
Even if the touch area No. is not correct, the error does not occur.
SampletouchTest.bas

Name getTouchStatus
Format int getTouchStatus()
Function Get touch status
Argument None
Return value
TOUCH_NONE not touch
TOUCH_BEGANbegan touching
TOUCH_MOVE move touching

Name getTouchPoint
Format int getTouchPoint(xys();float[,mode;int])
Function Returns the coordinates of the current screen touch.
Argument
xysOne demension float array include group of touch coordinate(graphic coordinate)
It returns the number present set as a pair of x,y.
The array will be stored in the order of x1,y1,x2,y2 ... .
So the number of the coordinate pair are the number of the array elements/2.
Max of 10 points can be read simultaneously.
(+0)=x coordinate , (+1)=y coordinate
When the size of the array is not big enough to the number of touch coordinates
(equal to double the number of touch points), just limit put on as the number of the array elements.
modeCoordinate acquiring mode
0(default)You get the current coordinates. You can not get when they are not in touch.
(the number of coordinate pairs is 0).
1You get to the last coordinate.
If being touched at least once in the past, the coordinate is returned.
Return value The number of coordinate pairs
When not been touched, it returns 0.
Note
  • It does not work with no setting of setTouchArea().
    To use getTouchPoint () without setting a valid touch area, you must call setTouchArea(0,0,0,0,0,YES) .
  • When there are multiple simultaneous touches, storage order of the coordinates is undefined.
  • In addition, depending on the specification of iOS, it may not return all coordinates when multiple touches.
  • At mode=0, you can get touch point coordinate while getTouchStatus()<>TOUCH_NONE.

Name setFunctionKey
Format setFunctionKey(no;int,title;str,keyCode;int)
Function Set function-key display string and key code.
Argument
nofunction-key No.
0 to 19 ; Among them, 10 to 19 are referred to as extended function keys.
titleString to be displayed in the function-key.
keyCodeKey code to return when you press this function-key.
Return value None
Get key code by inkey() or inkey$() when touch-area is touched.
Note The font of display string is followed the text screen font settings when calling this function.
SampletouchTest.bas

Name displayFunctionKey
Format displayFunctionKey(onoff;int[,st;int][,ed;int][,f2stage;int])
Function ON/OFF the display of the function-key in the specified range.
Argument
onoff
YESdisplay
NO erase
At onoff=NO, st and ed are ignored(always all).
stFunction-key No. to start to display ; 0 to 19. Default is 0.
edFunction-key No. to end to display ; 0 to 19. Default is 1-stage all.
f2stageSet whether to display function keys with many-stage when iPhone/iPod touch is portrait and the number of function keys is over 5 or iPad is any direction and the number of function keys is over 10.
YESTo be displayed in many-stage.
NO or defaultTo be displayed in one-stage.
However does not show the key that can not be displayed.
clearanceAdjust the display position of the function keys
clearance is not specified clearance is specified
text coordinate
mode
graphics coordinate
mode
-1
_
↓*2
last row
_
screen height/20
If you omit this, in text coordinate mode,
the function key display from last row of
text screen and go up 1 row at a time.
In graphic coordinate mode, it is in 1/20
increments of screen height.
The function-key width and location is determined by the screen width and the number of keys to display.
Approximate number of usable are as follows:
  Portrait Landscape
iPod touch
iPnone
5 10
iPad 10 10
Return value None
Note
  1. If you want to change the number of the function keys for displaying,
    it does not automatically turn off the display of the previous,
    so it is necessary to describe the process of erase. (Otherwise, the display will overlap.)
    Example:
     displayFunctionKey(ON,0,5)
      ~
     displayFunctionKey(OFF,0,5)
     displayFunctionKey(ON,0,2)
  2. It does not support automatic position change with rotate screen.

Name displayFunctionKeyAll
Format displayFunctionKeyAll(onoff;int[,f2stage;int][,fextend;int][,clearance;int])
Function ON/OFF the display of the all function-key within the screen width and only visible.
Argument 's.>
onoff
YESDisplay all function-key.
NO Erase all function key.
f2stageSet whether to display function keys with many-stage when iPhone/iPod touch is portrait and the number of function keys is over 5 or iPad is any direction and the number of function keys is over 10.
YESTo be displayed in many-stage.
NO or defaultTo be displayed in one-stage.
However does not show the key that can not be displayed.
fextend Whether extended function key(10 to 19) will display.
YESdisplay 0 to 19 all
NO or defaultdisplay 0 to 9
clearanceAdjust the display position of the function keys.
This is same asdisplayFunctionKey()
Return value None
SampletouchTest.bas

Name setFunctionKeyBackgroundImage
Format setFunctionKeyBackgroundImage([fname;str])
Function Paste the image in background of the function-key.
Argument
fnameJPEG or PNG image file name
If the image does not fit the function-key area, it will scaled appropriately.
It must set before displaying function keys by displayFunctionKey()/displayFunctionKeyAll().
Default is system standard background image.
The system prepares some standard images as follows:
funcBackG1.png
funcBackG2.png
funcBackM1.png
funcBackM2.png
funcBackR1.png
funcBackR2.png
funcBackW1.png
funcBackW2.png
funcBack.png(default image)
Return value None
SampletouchTest.bas

Name kBackgroundAlpha
Format kBackgroundAlpha(alpha;float)
Function Set transparency of the key screen.
Argument
alphaTransparency=0.0 to 1.0
It will lower the value, it will be more transparent.
Note you will no longer see at 0.0.
Return value None

Name hcopy
Format hcopy([fname;str[,quality;float]])
Function Output RUN screen's hard copy. It will change output by argument.
Argument
fnameOutput filename
omitPrint out for AirPrint printer.
extention is ".PNG"Outout for PNG image.
extention is ".JPG"Output for JPEG image.
extention is ".ALBUM"Output to album.
Extention does not case-sensitive.
qualityJPEG quality(0.0 to 1.0=default).
If you omit filename then you must also omit quality. This is not effective in PNG or album.
Return value
0OK
>0Error(file name illegal and so on)
Samplepicloader.bas

Name versionXBiOSKey$
Format versionXBiOSKey$()
Function Return key function's version.
Argument None
Return value The version string of the key function



// Sound functions


Name beep
Format beep()
Function Sound a beep equivalency beep2(1).
Argument None
Return value None

Name beep2
Format beep2([no;int][,floadOnly;int])
Function Sound a beep or iOS built-in sound.
Argument
no0〜13=beep sound No.
>=1000=iOS build-in sound
Default is 1.
Each beep sound is below:



The iOS built-in sound will play within the range of no=1000 to 1351(some missing).
For detail of built-in sound ,please check by sample program.
floadOnlyWhether only to load the sound data.YES=load only
NO=With sound. Default is NO.
This is invalid for iOS built-in sound.
Return value None
Note The beep2() will read the audio data at the time of the call.
Therefore, when the sound No. is not the same as the previous one, sound may be delayed.
In order to avoid this, you should pre-load by floadOnly = YES.
SamplebeepTest.bas

Name a_setPlayData
Format int a_setPlayData(fname;str[,rateNo;int])
Function Read sound file into buffer.
Max 64 tracks can be registered at the same time.
Argument
fname Sound file name.
Supported sound file format is below:
File extensionsformat
.aif .aiff AIFF (Audio Interchange File Format)
.caf CAF (Core Audio Format)
.mp3 MPEG-1 layer3
.aac MPEG2/MPEG4 Audio Data Transport Stream(ADTS)
.m4a .mp4 MPEG-4
.wav WAV (RIFF Waveform Audio Format)
.pcm X68000 ADPCM
.M44 44.1 KHz mono
signed 16bit PCM(big endian)
.M30 30.0 KHz mono
signed 16bit(Enable 12bit) PCM(big endian)
.P16 15.625KHz mono
signed 16bit(Enable 12bit) PCM(big endian)
Extension is necessary.
rateNoSampling rate No. Set only for .pcm file.
NumberSampling rate
0(Default) 15.6KHz
1 10.4KHz
2 7.8KHz
3 5.2KHz
4 3.9KHz
Return value
0 to 63Registered buffer number
-1There is no empty buffer
-2File not found

Name a_play
Format int a_play(no;int)
Function Play sound data in buffer.
It is depending on machine power Whether all tracks is able to play at the same time.
Up to 8 tracks are safe.
Argument
nobuffer number
Return value
0 to 63Played buffer number
-1Specified buffer is empty or number is out of range.
Attention ・Playback is performed in a multi-task.
・During sound playback, when you issue print statement (or equivalent functions) repeatedly very fast,
X-BASIC' may fall. (More precisely, it falls when accessing the font.)
To avoid this, it is necessary to reduce the frequency of calls print statement.
Example:
a_play(1)
repeat
    locate(0,0):print "Now playing":// sometime fall here
until a_stat(1)=0

Avoid example:
int i=0
repeat
    i=i+1
    if i>=100 then locate(0,0):print "Now playing"
until a_stat(1)=0

Or

repeat
    wait(0.05):// 50ms
    locate(0,0):print "Now playing"
until a_stat(1)=0
In addition, this is a problem in iOS.

Name a_end
Format int a_end(no;int)
Function Release sound buffer.
Argument
nobuffer number
Return value
0 to 63Released buffer number
-1Specified buffer is empty or number is out of range.

Name a_stop
Format int a_stop(no;int)
Function Pause playback.
Argument
nobuffer number
Return value
0 to 63buffer number
-1Specified buffer is empty or number is out of range.

Name a_cont
Format int a_cont(no;int)
Function Resume playback pausing by a_stop() or a specified number of times with a_loop() played.
Argument
nobuffer number
Return value
0 to 63buffer number
-1Specified buffer is empty or number is out of range.

Name a_volume
Format int a_volume(no;int,level;float)
Function Set playback volume level.
Argument
nobuffer number
levelvolume level = 0.0 to 1.0
0.0Mute
1.0Maximum
Return value
0 to 63buffer number
-1Specified buffer is empty or number is out of range.

Name a_speed
Format int a_speed(no;int,speed;float)
Function Set playback speed.
Argument
nobuffer number
speedspeed = 0.5 to 2.0
0.5half-speed
1normal-speed
2double-speed
Return value
0 to 63buffer number
-1Specified buffer is empty or number is out of range.

Name a_pan
Format int a_pan(no;int,pan;float)
Function Set stereo pan position.
Argument
nobuffer number
panpan position
-1.0Full left
0.0Center
1.0Full right
Return value
0 to 63buffer number
-1Specified buffer is empty or number is out of range.

Name a_loop
Format int a_loop(no;int,loopcnt;int)
Function Set the number of times a sound will retuen to the beginning,upon reaching to the end.
It is disable If you do not issue before a_play()/a_stop().
Argument
nobuffer number
loopcntloop count
>=1playback loopcnt times
0playback continue until a_stop()
Return value
0 to 63buffer number
-1Specified buffer is empty or number is out of range.

Name a_stat
Format int a_stat(no;int)
Function Get playback status.
Argument
nobuffer number
Return value
2 playing
0 stop (This will also a_stop())
Specified buffer is empty or number is out of range.

Name versionXBiOSSound$
Format versionXBiOSSound$()
Function Return sound function's version.
Argument None
Return value The version string of the sound function


// Motion functions


Name motionStart
Format int motionStart(dataSecond;int[,dno;int])
Function Start motion function.
Sampling rate is 100ms(fix).
Argument
dataSecondNumber of seconds data allocation.
Hold the data for the number of seconds.
Older data is overwritten.
dnodata type
MOTION_DEGREE Angle(default)
MOTION_VELOCITYVerocity
MOTION_ROTATION
MOTION_EULER
Euler angles
Return value
YESDisable to use motion functions.
The motion is using by joystick function.
The motion is using by other applications working in a background.
And so on.
NO Enable to use
SamplemotionTest.bas

Name motionSelectData
Format motionSelectData(dno;int)
Function Change data type.
Even if you switch the data type, it does not clear automatically the data in the buffer.
Note that when you read.
Argument
dnodata type
Return value None
SamplemotionTest.bas

Name motionGetRotation
Format float motionGetRotation(y;float,z;float)
Function Get motion data.
Argument
yReturn y-axis data. It gives with a variable because it put data.
zreturn z-axis data. It gives with a variable because it put data.
Return value x-axis data
The data returned will be as follows by data type.
If MOTION_ROTATION (MOTION_EULER) is set, the data having different meanings returned separately x/y/z.
dno MOTION_VELOCITY MOTION_DEGREE MOTION_ROTATION
MOTION_EULER
  Velocity
rad/sec
Degree
-90 to +90 degree
Euler angles
x x-axis x-axis pitch(-90 to +90 degree)
y y-axis y-axis roll(-90 to +90 degree)
z z-axis z-axis yaw(-180 to 180 degree)
You must call motionGetRotation() only when motionCount()>0.

The axis and euler angles are set for the main body as follows.
Axis
Euler angles
SamplemotionTest.bas

Name motionCount
Format int motionCount()
Function Return the number of recorded datas.
Argument None
Return value The number of datas
SamplemotionTest.bas

Name motionClear
Format motionClear()
Function Clear data.
Return value None
SamplemotionTest.bas

Name motionPause
Format motionPause(fpause;int)
Function Pause and resume to getting motion data.
Argument
fpause
YES pause
NO resume
Return value None
SamplemotionTest.bas

Name motionEnd
Format motionEnd()
Function Terminate motion function.
Argument None
Return value None
SamplemotionTest.bas

Name stickStart
Format int stickStart([threshold;float][,fcalibrate;int])
Function Start joystick function.
Sampling rate is 100ms(fix).
Argument
thresholdTilt angle ratio to regard to be input in each direction;10〜90(%)
Default is 30(%).
The larger the value, it is necessary to tilt significantly.
fcalibrateWhether to the automatic calibrate of the angle.
YESThe basis angle is to 0 at the time you call this function.
The angle you get will be automatically calibrated.
NO or defaultIt references to the horizontal.
Return value
YESDisable to use joystick functions.
The motion is using by motion function.
The motion is using by other applications working in a background.
And so on.
NO Enable to use
Note
Samplejoystick.bas

Name stick
Format int stick([mode;int])
Function Return the direction value as the tilt of the device.
Argument select the type of return value
YESreturn only up,down,left,right
NO or defaultreturn all direction
Return value
78(up)9
4(left)6(right)
12(down)3
Sample joystick.bas

Name stickEnd
Format stickEnd()
Function Terminate joysteick function.
Argument None
Return value None
Samplejoystick.bas

Name compassStart
Format int compassStart(max_data;int)
Function Start compass function.
Compass data is immediately retrieved when changing direction.
Argument
max_dataNumber of data allocation.
Hold the data for the number
Older data is overwritten.
Return value
YESDisable to use compass functions.
Main reason is below:
  • Your device has no digital compass(iPod touch).
  • Compass function is using by other applications working in a background/
NO Enable to use
Samplecompass.bas

Name compassGetData
Format float compassGetData([mag;float])
Function Get compass data.
Argument
magThe compass relative degree to magnetic north.
It gives with a variable because it put data.
Return value The compass relative degree to true north.
0North
45Northeast
90East
135Southeast
180South
225Southwest
270West
315Northwest
Note You must call compassGetData() only when compassCount()>0.
Samplecompass.bas

Name compassCount
Format int compassCount()
Function Return the number of recorded datas.
Argument None
Return value The number of datas
Samplecompass.bas

Name compassClear
Format compassClear()
Function Clear data.
Return value None
Samplecompass.bas

Name compassPause
Format compassPause(fpause;int)
Function Pause and resume to getting compass data.
Argument
fpause
YES pause
NO resume
Return value None
Samplecompass.bas

Name compassEnd
Format compassEnd()
Function Terminate compass function.
Argument None
Return value None
Samplecompass.bas

Name versionXBiOSMotion$
Format versionXBiOSMotion$()
Function Return motion/compass function's version.
Argument None
Return value The version string of the motion/compass function


// Another functions


Name emailSend
Format emailSend(subject;str,body;str[,attachment();str[,cnt;int][,zipfname;str]])
Function Send email
Argument
subject Subject message
body Body text
attachment Str array include attachment files names. Default is no attachment.
It may include a directory name but it must not specify the same name files in different directories.
If file is not exist then file does not attach.
cnt Use attachment filenames from attachment(0) to attachment(cnt-1).
Default is the number of elements in the attachment array.
zipfname Filename for zip compression. It need extension ".zip".
When this is specified, attachment files are compressed into the zip file.
In the zip file, directory structure are ignored.
If zip file can't create then zip file does not attach.
Return value None
SampleemailTest.bas , progSaver.bas

Name wait
Format int wait(tm;float[,fwait;int])
Function wait a few time
It is not so accurate(especially short time).
Argument
tm
greater than 0 and less equal 120waiting time(seconds). Under the decimal point is 100ms unit.
Example: wait(0.1) :// wait 100ms
<0check the wait time is elapsed.
fwait Whether to wait for the end of the specified time.
YESwait(default)
NO Not wait
Even if you set "not wait", you can not set multiple
(While before waiting remains, this returns NO).
If you do not want to wait, you determine the end of the waiting time by the return value.
Return value
YESTime has elapsed
NO Time does not have elapsed.
Note If you set fwait=NO, wait() is returned soon after waiting timer is set.
Thereafter, you check the return value of a function and determine whether the wait is completed.
Thus, it is possible to maintain a constant to the processing time for the zone.
Example
wait(1.0,NO):// From here
process
repeat:until wait(0.0):// to here, the processing time is always 1.0(or more) second.


// Accesory functions


Name osVersion
Format float osVersion()
Function Get iOS version.
Argument None
Return value
7.?iOS7.?
8.?iOS8.?
9.?iOS9.?

Name deviceType
Format int deviceType()
Function Get device type.
Argument None
Return value
DEVICE_UNKNOWN Unknown(Illegal)
DEVICE_IPAD iPad
DEVICE_IPODTOUCH iPod touch
DEVICE_IPHONE iPhone

Name devicePlatform
Format str devicePlatform()
Function Return device name with string.
Argument None
Return value Device name. They are as follows:
iPad ?* iPad
iPad Air ? * iPad Air
iPad mini ? * iPad mini
iPod touch ? iPod touch
iPhone ?* iPhone
iPhone 6 Plus iPhone 6 Plus
? is generation, and * is its derivatives.
Note The return string format is changed in V3.20.

Name isLocalizeJapan
Format int isLocalizeJapan()
Function Examine localized is Japanese.
It is set at "iOS Settings > General > International > Language".
Argument None
Return value
YES Japan
NO Except japan

Name getLanguage$
Format str getLanguage$()
Function Get localize information.
Argument None
Return value Return string of the IETF language tag.
Example
enEnglish
jaJapanese
Note
IETF language tag http://en.wikipedia.org/wiki/IETF_language_tag
ISO639 http://en.wikipedia.org/wiki/ISO_639

Name forcedSJIS
Format int forcedSJIS([mode;int])
Function Set forced SHIFT-JIS mode. And return current mode.
Argument
mode Forced SHIFT-JIS mode
YESTurn on the forced SHIFT-JIS mode
NO Turn off the Forced SHIFT-JIS mode
1 Only return the forced SHIFT-JIS mode at start of running.
2 Only return the current forced SHIFT-JIS mode (default).
Return value Return current forced SHIFT-JIS mode when mode is not 1.
When the mode is 1 then return the forced SHIFT-JIS mode at start of running.
The start of running means the forced SHIFT-JIS mode set in the settings basically.
When it is set AUTO, it will be a result of the judgment of source.
YES Forced SHIFT-JIS mode is ON
NO Forced SHIFT-JIS mode is OFF
SamplecodeSJIS.bas,codeUTF8.bas,v3test.bas

Name programName$
Format str programName$()
Function Get program name of running
Argument None
Return value program name

Name maxStringLength
Format int maxStringLength()
Function Return the max string length in the settings.
Argument None
Return value max string length(byte)

Name versionXBiOSAccesory$
Format versionXBiOSAccesory$()
Function Return accesory function's version.
Argument None
Return value The version string of the accesory function


// Debug functions


The debug functions provide the ability to help you debug a program.
The debug information is output to debug screen.
You can look it in running or after end.
Name debugMode
Format debugMode(mode;int,dumpMode;int)
Function Set the debug mode.
Argument
mode The timing of output debuf information
You can specify in the added value of the following constants:
DEBUG_MODE_NORMALOnlt at debugDump()
DEBUG_MODE_RETURNAt return from internal functions
DEBUG_MODE_BREAK At pushing Break button
DEBUG_MODE_END At execute statement 'end'
DEBUG_MODE_STOP At execute statement 'stop'
DEBUG_MODE_ERROR At error happen
DEBUG_MODE_ALL At all of above
dumpMode The information type of output
You can specify in the added value of the following constants:
DUMP_VAR_INTdump int variables
DUMP_VAR_FLOATdump float variables
DUMP_VAR_CHARdump char variables
DUMP_VAR_STRdump str variables
DUMP_VAR_ALLdump all type of variables
DUMP_DIM_INTdump int arrays
DUMP_DIM_FLOATdump float arrays
DUMP_DIM_CHARdump char arrays
DUMP_DIM_STRdump str arrays
DUMP_DIM_ALLdump all type of arrays
DUMP_DIM_WITH_ELEMENTS dump with all elements in array
DUMP_ONLY_GLOBALdump only global variables and arrays
DUMP_ONLY_LOCALdump only local variables and arrays
You never specify both DUMP_ONLY_GLOBAL + DUMP_ONLY_LOCAL.
If you omit both, it means to dump both global and local.
The global variable and array is displayed with its name, but local is not display with its name(value only).
The display order is as same as the decleared order.
Return value None
Note At program startup, the setting in the startup.bas, when pushing Break/execute stop/error happen, the variables and arrays are dumped.
Sampleexdim2.bas

Name debugDump
Format debugDump([dumpMode;int][,mes;str])
Function Dump variables to debug screen.
Argument
dumpModeInformation type of output. It is as same as debugMode()
Default is DUMP_VAR_ALL+DUMP_DIM_ALL.
mesThe message which is displayed before variable dump.
Default is no message.
Return value None
Sampleexdim2.bas,exdim.bas,dimDumpTest.bas

Name debugPrint
Format debugPrint([mes;str])
Function Display string to the debug screen.
Argument
mesdisplay message
Default is new line only.
You can include these display control codes in this message:
chr$(13)new line
chr$(9)tab
Return value None
Sampleexdim2.bas


All functions list (alphabetical order)

Type list

[Return]