 |
|
BaselScript |
Beschreibung
Notifications
Simple notifications.
Simple notifications are messages displayed at the top of screen under specified conditions (ANDROID)
Such notifications usually a title line, a line of text, and can call other scripts or scenes, when you touch them.
Example for one simple notification:
notification number = 1 title= #title_text text = "run draw polygon" callscript = name callscene = n flag = value sound = value
Description of parameters
number = n - notification number
title= string/#field - notification titel
text= string/#field - notification text
callscript = script name - called script after touching over notification
callscene= scene number - scene after touching over notification, default number = 1
flag = NoCancel - user can clean of notification, default - AutoCancel
sound = on/off the sound is activated (or not) when a notification appears
Start notificationin script:
start notification = number
Clear notifications
clear notifications
This command clear all notifications in memory.
19_0_notification,sceipt - example with 4 notifications:
scene=1 name="notification demo" cs=white
section init
// set parent script name for return from called scripts
#parent_script=19_0_notification
// notifications description
notification number=1 title= "mainmenu" text="press to jump" callscript=_mainmenu
notification number=2 title= "setting" text="press to jump" callscript=_setting flag=NoCancel sound=On
notification number=3 title= "graphic demo" text="draw chart" callscript=05_03_draw_chart
notification number=4 title= "graphic demo" text="draw chart lines" callscript=05_04_draw_chart_lines
draw form
end section
// 4 buttons
form
tile=property w=600 x=100 color=white gravity= center
tile=button name=#button1 action=pressed_button1 y=50 bgcolor=green text="call mainmenu"
tile=button name=#button2 action=pressed_button2 y=150 bgcolor=red text="setting"
tile=button name=#button3 action=pressed_button3 y=250 bgcolor=blue text="call draw_chart"
tile=button name=#button4 action=pressed_button4 y=350 bgcolor=gray text="call draw_chart_lines"
tile=text x=50 y=500 w=700 h=100 color=gray text=#help size=35 gravity= center
end form
// if button 1 was pressed - start notification 1
action pressed_button1
start notification= 1
end
// if button 2 was pressed - start notification 2
action pressed_button2
start notification= 2
end
// if button 3 was pressed - start notification 3
action pressed_button3
start notification=3
end
// if button 4 was pressed - start notification 4
action pressed_button4
start notification=4
end
// if pressed button BACK in bottom screen menu
action back
call script= examples3
end
end scene 1