It is currently Tue Apr 25, 2017 11:20 am



Welcome
Welcome to rfobasic

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. In addition, registered members also see less advertisements. Registration is fast, simple, and absolutely free, so please, join our community today. **You are not required to provide truthful information to any registration questions. Be whomever you wish to be.!


Post new topic Reply to topic  [ 86 posts ]  Go to page Previous  1 ... 3, 4, 5, 6, 7, 8, 9  Next
Author Message
 Post subject: Re: Hot summer of code
Unread postPosted: Fri Feb 17, 2017 2:29 pm 
Offline
User avatar

Joined: Mon Aug 18, 2014 1:16 pm
Posts: 1317
Hi Gregor

Success, Run from editor and then made APK

Regards Roy
Attachment:
DotyCircle.apk [514.82 KiB]
Downloaded 6 times

Attachment:
Doty.PNG
Doty.PNG [ 174.92 KiB | Viewed 403 times ]


Report this post
Top
 Profile  
 
 Post subject: Re: Hot summer of code
Unread postPosted: Sat Feb 18, 2017 12:39 am 
Offline
User avatar

Joined: Mon Aug 18, 2014 1:16 pm
Posts: 1317
Hi Gregor

When I do an app, others have said they do not like the background colour, with that in mind,
it would be good if there was a command for background colour

Code:
gr.backColor 255, 255, 0, 0

gr.paint.get myBackGround


Then you could have an option, in the app, for the user to change the background colour

Is that a possibility

Regards Roy


Report this post
Top
 Profile  
 
 Post subject: Re: Hot summer of code
Unread postPosted: Sun Feb 19, 2017 11:59 am 
Offline
User avatar

Joined: Wed Jul 10, 2013 8:11 am
Posts: 299
Hi roy

roy wrote:
Hi Gregor

When I do an app, others have said they do not like the background colour, with that in mind,
it would be good if there was a command for background colour

Code:
gr.backColor 255, 255, 0, 0

gr.paint.get myBackGround


Then you could have an option, in the app, for the user to change the background colour

Is that a possibility

Regards Roy


Let us try domestic remedies first:

Code:
GR.OPEN 255, 0, 0, 0
GR.ORIENTATION -1  % Force sensor
GR.SCREEN w, h
s = max(w,h)
gr.color 255,255,255,255,1
gr.rect background, 0, 0, s, s
gr.get.value background, "paint", pBg
gr.color 255,0,0,0,2
gr.rect rc1, 50, 50, 100, 100
gr.render
pause 4000
gr.color 255,50,0,200, , pBg
gr.render
pause 4000
gr.color 255,120,50,0, , pBg
gr.render

do
until 0


Happy coding

Gregor


Report this post
Top
 Profile  
 
 Post subject: Re: Hot summer of code
Unread postPosted: Sun Feb 19, 2017 1:37 pm 
Offline
User avatar

Joined: Mon Aug 18, 2014 1:16 pm
Posts: 1317
Thanks Gregor

That works well, I shall use you code in my next app

Regards Roy


Report this post
Top
 Profile  
 
 Post subject: Re: Hot summer of code
Unread postPosted: Mon Feb 20, 2017 1:46 am 
Offline
User avatar

Joined: Sat Dec 08, 2012 2:14 am
Posts: 1128
Location: From Blighty
Really nice enhancements Gregor, and been meaning to try for ages.

Can you run through this code for me and check if I'm doing something wrong?

I have installed test version of BASIC! OliBasicXI.

The ONKEYDOWN interupt with the headset does not appear to work in graphics mode?

When I REM the graphics code out it detects everything well in console mode as per your code example.

Code:
VOLKEYS.ON
KEYDOWN.ON

x = 20
y = 20
GR.OPEN 255, 0, 0, 0, 0, 1

GR.COLOR 255, 255, 255, 255, 1

GR.CIRCLE ball, x, y, 10

DO
GR.MODIFY ball, "x", x, "y", y
GR.RENDER
UNTIL 0

ONKEYDOWN:
INKEY$ mKey$, mKeyEvent$
if mkey$ ="key 24" THEN x = x + 10
if mkey$ ="key 25" THEN x = x - 10
PRINT "INCREMENT",  x
KEYDOWN.RESUME

ONKEYPRESS:
INKEY$ mKey$,mKeyEvent$
PRINT "Get ";mKey$,"  ";mKeyEvent$
KEY.RESUME

END


Mog


Report this post
Top
 Profile  
 
 Post subject: Re: Hot summer of code
Unread postPosted: Mon Feb 20, 2017 3:00 am 
Offline
User avatar

Joined: Mon Aug 18, 2014 1:16 pm
Posts: 1317
Hi Mog

if you put a 'dialog.message under each print statement, you can see whats happening in graphic mode

Roy

Code:


REM Start of BASIC! Program Keys.bas

VOLKEYS.ON
! NEW
KEYDOWN.OFF %No Key Down Detection
gr.open 255, 100, 100, 200

DO
INKEY$ key$ %Also a good place for INKEY$ is behind
!ONKEPRESS: or ONKEYDOWN:
UNTIL key$ <> "@"
PRINT key$
dialog.message key$,,ok,"OK"
! Better, if you want correct results after ONKEY...
mKey$="@"
DO
UNTIL mKey$ <> "@"
PRINT mKey$
dialog.message mkey$,,ok,"OK"
! NEW
KEYDOWN.ON % and the opposite KEYDOWN.OFF

DO
UNTIL 0


! NEW
ONKEYDOWN: %A Key Is Down interrupt
! NEW
! The second string key event parameter
INKEY$ mKey$,mKeyEvent$
PRINT "Get ";mKey$,"  ";mKeyEvent$ : end
dialog.message "Get " + mKey$ + "  " + mKeyEvent$,,ok,"OK"
! NEW
KEYDOWN.RESUME %Resumes execution at the point BASIC! program where
               !the OnKeyDown: interrupt occured.

ONKEYPRESS: %Imo ONKEYUP points the fact better
INKEY$ mKey$,mKeyEvent$
PRINT "Get ";mKey$,"  ";mKeyEvent$
dialog.message "Get " + mKey$ + "  " + mKeyEvent$,,ok,"OK"
KEY.RESUME

END


Report this post
Top
 Profile  
 
 Post subject: Re: Hot summer of code
Unread postPosted: Mon Feb 20, 2017 6:41 am 
Offline
User avatar

Joined: Sat Dec 08, 2012 2:14 am
Posts: 1128
Location: From Blighty
Thanks Roy,

Perhaps I'm not explaining correctly what I'm trying to do...

I was hoping to keep a live loop running through game play, for example if I was writing a 'Pong' clone. Wanting to animate the ball as well as moving the paddle.

I simplified some code just as an example.

The interrupt works for ONKEYPRESS BASIC! V1.90, it's just this new command ONKEYDOWN, I can't seem to get it working with this test version in GR mode.

Unless I'm doing something incredibly stupid?

Mog

Edit: I've tried also putting PAUSE's in the main loop, and after graphics gets opened, neither worked.


Report this post
Top
 Profile  
 
 Post subject: Re: Hot summer of code
Unread postPosted: Mon Feb 20, 2017 11:37 am 
Offline
User avatar

Joined: Mon Aug 18, 2014 1:16 pm
Posts: 1317
Hi Mog

I've done some testing and can't get ONKEYDOWN: to work in graphic mode, although ONKEYPRESS: dose.

Over to Gregor

Regards Roy


Report this post
Top
 Profile  
 
 Post subject: Re: Hot summer of code
Unread postPosted: Mon Feb 20, 2017 5:16 pm 
Offline
User avatar

Joined: Wed Jul 10, 2013 8:11 am
Posts: 299
Hi Mog, hi roy,

Quote:
I've done some testing and can't get ONKEYDOWN: to work in graphic mode, although ONKEYPRESS: dose.


Yes it is true.
I should be able to solve the problem, but it is an old open construction site.
I have to dive deeper.

Gregor


Report this post
Top
 Profile  
 
 Post subject: Re: Hot summer of code
Unread postPosted: Mon Feb 27, 2017 6:12 pm 
Offline
User avatar

Joined: Wed Jul 10, 2013 8:11 am
Posts: 299
Hi,

New version XIV now on Github.
Added more or less all enhancements from Nicolas.

Description as an appendix to the current manual.

A new AUDIO.INFO

Code:
JazzFunkSoulRadio$="http://198.105.223.94:****"
e$ = "http://amp1.cesnet.cz:8000/cro1.ogg"
!e$ = einsLiveDj$
gg$ = "JazzFunkSoulRadio" + "    "
! e$ = "Brickhouse.mp3"
file.root newPath$, "_Music"
! e$ = "file://" + newPath$ + "/" + "George Benson - Nuthin' But A Party.mp3"
?"audio.load \""+e$+"\""
c0=CLOCK()
AUDIO.LOAD a, e$
IF !a THEN END GETERROR$()
?"stream opened in "+INT$((CLOCK()-c0)/1000)+"s"
?"audio.play", a
AUDIO.STOP
AUDIO.PLAY a
?"hit back or touch this line to stop"
AUDIO.INFO a, bb
BUNDLE.GET bb,"_Artist", artist$
BUNDLE.GET bb, "_Title", title$
IF artist$ + title$ <> ""
gg$ = artist$ + " - " + title$ + "    "
ENDIF

TIMER.SET 600

DO
UNTIL 0

ONTIMER:
GG$ = MID$(GG$, 2) + LEFT$(GG$, 1)
CONSOLE.TITLE (GG$)
TIMER.RESUME
ONBACKKEY:
ONCONSOLETOUCH:
AUDIO.STOP
END "-stopped-"


New BUNDLE.IN, returns a bundle with received data when calling from an other App.
New features in file handling
....
The automatic low memory Warning is switched off. Use instead OnLowMemory:.
The Global Value Backdoor, after an interrupt is trapped, is now closed.
Sometimes SELECT crashes, if to many data in List or Array, is fixed.

[quote="aFox"]Hi Mog, hi roy,

Quote:
I've done some testing and can't get ONKEYDOWN: to work in graphic mode, although ONKEYPRESS: dose.


Yes it is true.
I should be able to solve the problem, but it is an old open construction site.
I have to dive deeper.

Gregor


That should be now fixed in XIV.


See https://github.com/RFO-BASIC/Basic/files/805485/OliBasicXIV.zip

Happy coding
Gregor

Report this post
Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 86 posts ]  Go to page Previous  1 ... 3, 4, 5, 6, 7, 8, 9  Next


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
suspicion-preferred