|
Post by regoroxford on Aug 16, 2018 20:44:18 GMT -5
Searching for "touch" or "touch screen" in the last 1000 days doesn't produce any useful information. The older website did produce good hits. Can someone suggest links or search phrases to get adequate examples of Liberty basic touch screen programming? Tks, Ox
|
|
|
Post by metro on Aug 17, 2018 0:27:16 GMT -5
this may help some, posted By Rod on the old forum Thread started on: Apr 6th, 2016, 06:53am » This is modelled on Richard's demo of MultiTouch input. But API is not my best skill. Tantilizingly close to getting info though. It's my structs that will be wrong. I am getting Gesture messages but I have not as yet managed to get anything out of the Struct.
Any help appreciated, it uses wmliberty, WM_GESTURE info at msdn, will add links later.
nomainwin global WM.TOUCH, hWnd, nPoints, ptrStructArray,sizeofTi global panning, zooming, zoomStart, currentZoom, scale, imgWidth, imgHeight, scrWidth, scrHeight, hPic,sDC,mDC WM.TOUCH = hexdec("0240")
'setup arrays and structs to receive touch input data dim pt(11,2) ' 6 x touchpoints ' + 7 = start point ' 8 = offset from start ' 9 = original/last offset ' 10 = zoom start ' 11 = zoom end
'a normal struct for the xy points Struct pt, x As long, y As long 'a normal struct that will be used to define an array of structs Struct ti, x As long, _ y As long, _ hSource As ulong, _ dwID As long, _ dwFlags As long, _ dwMask As long, _ dwTime As long, _ dwExtraInfo As long, _ cxContact As long, _ cyContact As long
'the size of the structure is sizeofTi = Len(ti.struct) 'the amount of memory needed for the array is maxPoints=6 memBlockSize = maxPoints*sizeofTi 'allocate memory and get pointer using Richards simplifications 'structs are accessed by sizeofTi offset 'so ti.struct=ptrStructArray+sizeofTi*i i=0-5 ptrStructArray = GlobalAlloc(memBlockSize)
'open a window and graphicbox Open "WMLiberty" For DLL As #wmlib WindowWidth = 800 WindowHeight = 600 scrWidth=400 scrHeight=300 graphicbox #w.gb, 200, 100, scrWidth, scrHeight Open "Pan Zoom Demo" For window As #w hWnd = hwnd(#w.gb) #w "trapclose quit" #w.gb "down"
'get the image file to display open "gdiplus.dll" for dll as #gdip filedialog "Choose an image","*.jpg;*.png;*.tiff;*.ico;*.bmp;*.gif",file$ if file$="" then call quit "No File" else hPic=LoadImgFromFile(file$) if hPic<>0 then loadbmp "pic",hPic else notice "Could not load the image file!" end if end if
'get the image size 'Struct necessary for returning image file information Struct ImageInfo, _ imgType as Long, _ imgWidth as Long, _ imgHeight as Long, _ imgWidthBytes as Long, _ imgPlanes as Word, _ imgBitsPixel as Word, _ imgBits as Long lStruct = Len(ImageInfo.struct) CallDLL #gdi32, "GetObjectA", _ hPic as uLong, _ lStruct as Long, _ ImageInfo as struct, _ result as Long imgWidth = ImageInfo.imgWidth.struct imgHeight = ImageInfo.imgHeight.struct
'place the image centred at scale 1 scale=1 pt(9,1)=(scrWidth-imgWidth)/2 pt(9,2)=(scrHeight-imgHeight)/2
' sDC is our screen, (DC handle to the graphicsbox) sDC=GetDC(hWnd)
' mDC is a copy of the screen in memory mDC=CreateCompatibleDC(sDC)
'select the pic into the DC oldBmp=SelectObject(mDC,hPic)
'draw it from memory to screen call StretchBlt,sDC,int(pt(9,1)*scale),int(pt(9,2)*scale),int(imgWidth*scale),int(imgHeight*scale),mDC,0,0,imgWidth,imgHeight
' set up callback to receive touch messages callback lpwmtouch, wmtouch(ulong, ulong, ulong, ulong), long calldll #wmlib, "SetWMHandler", hWnd As ulong, _ WM.TOUCH As ulong, _ lpwmtouch As ulong, _ 1 As long, _ ret As long
' register the window for touch messaging calldll #user32, "RegisterTouchWindow", hWnd As ulong, _ 0 As ulong, _ lpwmtouch As ulong, _ ret As long
' now scan for messages [wait] ' Must use a Scan loop. Scan Call plot CallDLL #kernel32, "Sleep", 5 As Long, ret As Void GoTo [wait]
Sub plot 'get all the touch point info into an array, up to six points For i = 0 To nPoints-1 'fill the ti.struct from the offset ti.struct=ptrStructArray+sizeofTi*i 'get the screen coordinates pt.x.struct = ti.x.struct / 100 pt.y.struct = ti.y.struct / 100 CallDLL #user32, "ScreenToClient", hWnd As ulong, _ pt As struct, _ ret As long pt(i,1)=pt.x.struct pt(i,2)=pt.y.struct Next i
'if we have two touch points start or continue zooming if nPoints=2 then 'zooming if zooming=0 then zooming=1 'start points saved pt(10,1)=pt(0,1) pt(10,2)=pt(0,2) pt(11,1)=pt(1,1) pt(11,2)=pt(1,2) 'how far appart are the fingers zoomStart=sqr(pt(10,1)*pt(11,1)+pt(10,2)*pt(11,2)) 'print "zoom start ",zoomStart else 'how far appart are the fingers now 'and how different is that from zoomStart currentZoom=(zoomStart-sqr(pt(0,1)*pt(1,1)+pt(0,2)*pt(1,2)))/100 s=scale+currentZoom 'print "current zoom ";s call StretchBlt,sDC,int((pt(9,1)-pt(8,1))*s),int((pt(9,2)-pt(8,2))*s),int(imgWidth*s),int(imgHeight*s),mDC,0,0,imgWidth,imgHeight end if
end if
'if we have one touch point start or continue panning if nPoints=1 and zooming=0 then 'panning if panning=0 then panning=1 'start point saved 'print "panning start ";pt(0,1),pt(0,2) pt(7,1)=pt(0,1) pt(7,2)=pt(0,2) else 'current offset is start point - current point pt(8,1)=pt(7,1)-pt(0,1) pt(8,2)=pt(7,2)-pt(0,2) 'print "panning offset ";pt(8,1),pt(8,2) 'limit panning range of original offset plus current offset if pt(9,1)-pt(8,1)>0 then pt(9,1)=0 : pt(8,1)=0 if pt(9,1)-pt(8,1)<scrWidth-imgWidth then pt(9,1)=scrWidth-imgWidth : pt(8,1)=0 if pt(9,2)-pt(8,2)>0 then pt(9,2)=0 : pt(8,2)=0 if pt(9,2)-pt(8,2)<scrHeight-imgHeight then pt(9,2)=scrHeight-imgHeight : pt(8,2)=0 'print scale,int(pt(9,1)*scale),int(pt(9,2)*scale),int(imgWidth*scale),int(imgHeight*scale) 'draw it correctly sized and offset s=scale+currentZoom call StretchBlt,sDC,int((pt(9,1)-pt(8,1))*s),int((pt(9,2)-pt(8,2))*s),int(imgWidth*s),int(imgHeight*s),mDC,0,0,imgWidth,imgHeight end if end if
'if we have no touch points consider gesture stops if nPoints=0 and zooming then 'stop 'save scale scale=scale+currentZoom currentZoom=0 'print "Zooming stopped ";scale zooming=0 end if if nPoints=0 and panning then 'stop panning=0 'save original offset pt(9,1)=pt(9,1)- pt(8,1) pt(9,2)=pt(9,2)- pt(8,2) 'print "Panning stopped ";pt(9,1),pt(9,2) end if
nPoints = 0 End Sub
Sub quit h$ if pic then unloadbmp "pic" calldll #gdi32,"DeleteObject",hPic as ulong, ret as ulong'Because LB doesnt delete it for us. close #gdip Close #wmlib ret = GlobalFree(ptrStructArray) Close #w End End Sub
Function wmtouch(hw, msg, wparam, lparam) nPoints = wparam And hexdec("FFFF") If nPoints > 6 Then nPoints = 6 CallDLL #user32, "GetTouchInputInfo", lparam As ulong, _ nPoints As ulong, _ ptrStructArray As ulong, _ sizeofTi As long, _ ret As long CallDLL #user32, "CloseTouchInputHandle", lparam As ulong, _ ret As long End Function
Function GlobalAlloc( dwBytes ) 'returns pointer to fixed memory block. CallDLL #kernel32, "GlobalAlloc", 0 As long, _ dwBytes As ulong, _ GlobalAlloc As long End Function
Function GlobalFree( hMem ) CallDLL #kernel32, "GlobalFree", hMem As ulong, _ GlobalFree As long End Function
function wchar$(string$) for i = 1 to len(string$) wchar$=wchar$+mid$(string$,i,1)+chr$(0) next i wchar$=wchar$+chr$(0)+chr$(0) end function
function LoadImgFromFile(file$) struct dword,a as ulong gdistart$=chr$(1) for i = 1 to 15 gdistart$=gdistart$+chr$(0) next i calldll #gdip,"GdiplusStartup",dword as struct,gdistart$ as ptr,status as ulong token=dword.a.struct if status<>0 then LoadImgFromFile=0 else wFileLoc$=wchar$(file$) calldll #gdip,"GdipCreateBitmapFromFile",wFileLoc$ as ptr,dword as struct,status as ulong hPic=dword.a.struct if status<>0 then LoadImgFromFile=0 else calldll #gdip,"GdipCreateHBITMAPFromBitmap",hPic as ulong,dword as struct,0 as ulong,status as ulong hBmp=dword.a.struct if status<>0 then LoadImgFromFile=0 else LoadImgFromFile=hBmp end if calldll #gdip,"GdipDisposeImage",hPic as ulong,ret as ulong end if calldll #gdip,"GdiplusShutdown",token as ulong,ret as ulong end if end function
User IP Logged
|
|
|
Post by metro on Aug 17, 2018 0:36:15 GMT -5
Some more code from Rod April 17th 2016
nomainwin global WM.GESTURE, imgX, imgY, imgScale, imgWidth, imgHeight, scrWidth, scrHeight, hWnd,sDC,mDC,hPic global panning, zooming, panX,panY,startX,startY,startZ,deltaZ WM.GESTURE = 281
'a struct for the xy points Struct pt, x As long, y As long
'a struct for the gestureinfo data Struct gi, cbSize As ulong, _ dwFlags As ulong, _ dwID As ulong, _ hwndTarget As ulong, _ x As short, _ y As short, _ dwInstanceID As ulong, _ dwSequenceID As ulong, _ ullArgHi As ulong, _ ullArgLow As ulong, _ cbExtraArgs As ulong, _ a As ulong,_ b as ulong
'the size of the structure is gi.cbSize.struct = Len(gi.struct)
'get the image file to display filedialog "Choose an image","*.jpg;*.png;*.tiff;*.ico;*.bmp;*.gif",file$ if file$="" then call quit "No File" else hPic=LoadImgFromFile(file$) if hPic<>0 then loadbmp "pic",hPic else notice "Could not load the image file!" end if end if
'get the image size 'Struct necessary for returning image file information Struct ImageInfo, _ imgType as Long, _ imgWidth as Long, _ imgHeight as Long, _ imgWidthBytes as Long, _ imgPlanes as Word, _ imgBitsPixel as Word, _ imgBits as Long lStruct = Len(ImageInfo.struct) CallDLL #gdi32, "GetObjectA", _ hPic as uLong, _ lStruct as Long, _ ImageInfo as struct, _ result as Long imgWidth = ImageInfo.imgWidth.struct imgHeight = ImageInfo.imgHeight.struct imgScale=1 scrWidth=600 scrHeight=400 imgX=(scrWidth-imgWidth)/2 imgY=(scrHeight-imgHeight)/2
Open "WMLiberty" For DLL As #wmlib WindowWidth = 800 WindowHeight = 600 graphicbox #w.gb,100,100,scrWidth,scrHeight Open "Gesture demo" For graphics_nf_nsb As #w hWnd = hwnd(#w.gb) #w "trapclose quit" #w.gb "down; fill black"
' sDC is our screen, (DC handle to the graphicsbox) sDC=GetDC(hWnd)
' mDC is a copy of the screen in memory mDC=CreateCompatibleDC(sDC)
'select the pic into the DC oldBmp=SelectObject(mDC,hPic)
'draw it from memory to screen call StretchBlt,sDC,int(imgX*imgScale),int(imgY*imgScale),int(imgWidth*imgScale),int(imgHeight*imgScale),mDC,0,0,imgWidth,imgHeight
' set up callback to receive touch messages callback lpwmgesture, wmgesture(ulong, ulong, ulong, ulong), long calldll #wmlib, "SetWMHandler",_ hWnd As ulong, _ WM.GESTURE As ulong, _ lpwmgesture As ulong, _ 1 As long, _ ret As long
' now scan for messages [wait] ' Must use a Scan loop. Scan CallDLL #kernel32, "Sleep",_ 50 As Long,_ ret As Void GoTo [wait]
Sub quit h$ Close #w Close #wmlib End End Sub
Function wmgesture(hw, msg, wparam, lparam) 'print hw,msg,wparam,lparam CallDLL #user32, "GetGestureInfo",_ lparam As ulong, _ gi As struct,_ ret As long pt.x.struct = gi.x.struct pt.y.struct = gi.y.struct CallDLL #user32, "ScreenToClient",_ hw As ulong, _ pt As struct, _ ret As long
select case wparam case 1 'GID_BEGIN 'print "Gesture begins" case 2 'GID_ENDS 'print "Gesture ends" if panning then imgX=imgX+panX imgY=imgY+panY panX=0 panY=0 panning=0 end if if zooming then imgScale=imgScale+deltaZ deltaZ=0 zooming=0 imgX=imgX+panX imgY=imgY+panY panX=0 panY=0 end if case 3 'GID_ZOOM 'print "Zooming" if zooming then deltaZ=gi.ullArgLow.struct/100-startZ panX=0-deltaZ*10 panY=0-deltaZ*10 if imgWidth*(imgScale+deltaZ)<scrWidth then imgScale=scrWidth/imgWidth : deltaZ=0 :imgX=0 if imgHeight*(imgScale+deltaZ)<scrHeight then imgScale=scrHeight/imgHeight : deltaZ=0 : imgY=0 else zooming=1 startZ=gi.ullArgLow.struct/100 end if
case 4 'GID_PAN if panning then panX=pt.x.struct-startX panY=pt.y.struct-startY if imgX+panX >0 then imgX=0 : panX=0 if imgX+panX <scrWidth-imgWidth then imgX=scrWidth-imgWidth : panX=0 if imgY+panY >0 then imgY=0 : panY=0 if imgY+panY <scrHeight-imgHeight then imgY=scrHeight-imgHeight : panY=0 else panning=1 startX=pt.x.struct startY=pt.y.struct end if
case 5 'GID_ROTATE 'print "Rotating" case 6 'GID_TWOFINGURETAP 'print "Two fingure tap" imgScale=scrWidth/imgWidth panning=0 panX=0 panY=0 zooming=0 deltaZ=0 imgX=0 imgY=0 case 7 'GID_PRESSANDTAP 'print "Press and tap" end select x=int((imgX+panX)*(imgScale+deltaZ)) y=int((imgY+panY)*(imgScale+deltaZ)) w=int(imgWidth*(imgScale+deltaZ)) h=int(imgHeight*(imgScale+deltaZ)) call StretchBlt,sDC,x,y,w,h,mDC,0,0,imgWidth,imgHeight 'forward start and end messages to window if wparam=1 or wparam=2 then CallDll #user32, "DefWindowProcA",_ hw As ulong,_ msg As ulong,_ wparam As ulong,_ lparam As ulong,_ ret As long else CallDLL #user32, "CloseGestureInfoHandle",_ lparam As ulong, _ ret As long end if
End Function
'=============================Load image functions================================= function wchar$(string$) for i = 1 to len(string$) wchar$=wchar$+mid$(string$,i,1)+chr$(0) next i wchar$=wchar$+chr$(0)+chr$(0) end function
function LoadImgFromFile(file$) open "gdiplus.dll" for dll as #gdip struct dword,a as ulong gdistart$=chr$(1) for i = 1 to 15 gdistart$=gdistart$+chr$(0) next i calldll #gdip,"GdiplusStartup",_ dword as struct,_ gdistart$ as ptr,_ status as ulong token=dword.a.struct if status<>0 then LoadImgFromFile=0 else wFileLoc$=wchar$(file$) calldll #gdip,"GdipCreateBitmapFromFile",_ wFileLoc$ as ptr,_ dword as struct,_ status as ulong hPic=dword.a.struct if status<>0 then LoadImgFromFile=0 else calldll #gdip,"GdipCreateHBITMAPFromBitmap",_ hPic as ulong,_ dword as struct,_ 0 as ulong,_ status as ulong hBmp=dword.a.struct if status<>0 then LoadImgFromFile=0 else LoadImgFromFile=hBmp end if calldll #gdip,"GdipDisposeImage",_ hPic as ulong,_ ret as ulong end if calldll #gdip,"GdiplusShutdown",_ token as ulong,_ ret as ulong end if close #gdip end function
'=============================Window and DC functions================================= Function GetDC(hWnd) CallDLL #user32, "GetDC",_ hWnd As ulong,_ 'window or control handle GetDC As ulong 'returns device context End Function
Sub ReleaseDC hWnd, hDC CallDLL#user32,"ReleaseDC",_ hWnd As ulong,_ 'window or control handle hDC As ulong,_ 'handle of DC to delete result As Long End Sub
Function CreateCompatibleDC(hDC) CallDLL #gdi32,"CreateCompatibleDC",_ hDC As ulong,_ 'window DC CreateCompatibleDC As ulong 'memory DC End Function
Sub DeleteDC hDC CallDLL #gdi32, "DeleteDC",_ hDC As ulong,_ 'memory DC to delete r As Boolean End Sub
Sub StretchBlt hDCdest,x,y,w,h,hDCsrc,x2,y2,w2,h2 CallDLL #gdi32, "SetStretchBltMode",_ hDCdest As ulong,_ 'device context _COLORONCOLOR As Long,_ 'color reduction mode RESULT As Long CallDLL #gdi32, "StretchBlt",_ hDCdest As ulong,_ 'destination x As Long,_ 'destination x pos y As Long,_ 'destination y pos w As Long,_ 'destination width desired h As Long,_ 'destination height desired hDCsrc As ulong,_ 'source x2 As Long,_ 'x location to start from source y2 As Long,_ 'y location to start from source w2 As Long,_ 'width desired from source h2 As Long,_ 'height desired from source _SRCCOPY As long,_ 'dwRasterOperation RESULT As Boolean End Sub
Function SelectObject(hDC,hObject) CallDLL #gdi32,"SelectObject",_ hDC As ulong,_ 'memory device context hObject As long,_ 'handle of object SelectObject As long 'returns previously selected object End Function
|
|
|
Post by Rod on Aug 18, 2018 1:27:12 GMT -5
You only need to delve into “gesture” code if you want to react to the new touch inputs like two fingered panning and multi finger touch. Mostly Your touch screen will mimic everything you can do with a mouse. That’s where to go to use simple touch input, when mouse... event handling.
What is the specific problem you are trying to solve?
|
|
|
Post by Rod on Aug 18, 2018 3:06:15 GMT -5
This is a multitouch demo, it returns several touch points as one input. Touch the screen with more than one finger. If you get nothing your touch screen does not support Gesture input.
' Multi-touch demo by Richard Russell, http://www.rtrussell.co.uk/ ' amended for Liberty BASIC by Brandon and Rod using Dennis McKinney's ' http://lbpe.wikispaces.com/ArraysAndStructs ' Uses WMLiberty.DLL (http://www.b6sw.com/forum/download.php?id=16)
nomainwin Global WM.TOUCH, hWnd, nPoints, ptrStructArray,sizeofTi WM.TOUCH = hexdec("0240")
'a normal struct for the xy points Struct pt, x As long, y As long
'a normal struct that will be used to define an array of structs Struct ti, x As long, _ y As long, _ hSource As ulong, _ dwID As long, _ dwFlags As long, _ dwMask As long, _ dwTime As long, _ dwExtraInfo As long, _ cxContact As long, _ cyContact As long
'the size of the structure is sizeofTi = Len(ti.struct)
'the amount of memory needed for the array is maxPoints=6 memBlockSize = maxPoints*sizeofTi
'allocate memory and get pointer using Richards simplifications 'structs are accessed by sizeofTi offset 'so ti.struct=ptrStructArray+sizeofTi*i i=0-5 ptrStructArray = GlobalAlloc(memBlockSize)
Open "WMLiberty" For DLL As #wmlib WindowWidth = 800 WindowHeight = 600 Open "Multi-touch demo" For graphics As #w hWnd = hwnd(#w) #w "trapclose quit" #w "down; fill black ; backcolor red"
' set up callback to receive touch messages callback lpwmtouch, wmtouch(ulong, ulong, ulong, ulong), long calldll #wmlib, "SetWMHandler", hWnd As ulong, _ WM.TOUCH As ulong, _ lpwmtouch As ulong, _ 1 As long, _ ret As long
' register the window for touch messaging calldll #user32, "RegisterTouchWindow", hWnd As ulong, _ 0 As ulong, _ lpwmtouch As ulong, _ ret As long
' now scan for messages [wait] ' Must use a Scan loop. Scan Call plot CallDLL #kernel32, "Sleep", 5 As Long, ret As Void GoTo [wait]
Sub plot For i = 0 To nPoints-1 'fill the ti.struct from the offset ti.struct=ptrStructArray+sizeofTi*i 'get the screen coordinates pt.x.struct = ti.x.struct / 100 pt.y.struct = ti.y.struct / 100 CallDLL #user32, "ScreenToClient", hWnd As ulong, _ pt As struct, _ ret As long #w "place ";pt.x.struct;" ";pt.y.struct #w "circlefilled 50" Next i nPoints = 0 End Sub
Sub quit h$ Close #wmlib ret = GlobalFree(ptrStructArray) Close #w End End Sub
Function wmtouch(hw, msg, wparam, lparam) nPoints = wparam And hexdec("FFFF") If nPoints > 6 Then nPoints = 6 CallDLL #user32, "GetTouchInputInfo", lparam As ulong, _ nPoints As ulong, _ ptrStructArray As ulong, _ sizeofTi As long, _ ret As long CallDLL #user32, "CloseTouchInputHandle", lparam As ulong, _ ret As long End Function
Function GlobalAlloc( dwBytes ) 'returns pointer to fixed memory block. CallDLL #kernel32, "GlobalAlloc", 0 As long, _ dwBytes As ulong, _ GlobalAlloc As long End Function
Function GlobalFree( hMem ) CallDLL #kernel32, "GlobalFree", hMem As ulong, _ GlobalFree As long End Function
|
|
|
Post by Rod on Aug 18, 2018 3:59:48 GMT -5
This demo Janet posted on the LBPE shows left and right mouse button event trapping. It was not designed for touch input. Using the mouse, right clicking or left clicking on the screen changes the screen color. Now with your finger press and release on the screen. Then press, hold and release. This is touch mimicking mouse input. Whether many user know how to use touch might be debated. But I am not sure we are answering the original question.
' ' Demo demonstrating ' When leftButtonUp ' When rightButtonUp
WindowWidth = 407 WindowHeight = 350
UpperLeftX = Int((DisplayWidth - WindowWidth)/2) UpperLeftY = Int((DisplayHeight - WindowHeight)/2)
' Define a Menu Menu #main, "&Options", "E&xit", [EndDemo] ' Define a Graphicbox Graphicbox #main.g, 0, 0, 400, 300 ' Open the Window Open "The Mouse When Commands" for Window as #main ' Add the Trapclose statement to properly end the program Print #main, "Trapclose [EndDemo]" ' Add the When leftButtonUp command Print #main.g, "When leftButtonUp [ButtonLeftUp]" Print #main.g, "When rightButtonUp [ButtonRightUp]"
' Place the pen in the Down position Print #main.g, "Down" ' Fill the graphicbox with Darkcyan Print #main.g, "Fill Darkcyan" ' Assign the pen color as Darkblue Print #main.g, "Color Darkblue" ' Assign the backcolor as Darkcyan Print #main.g, "Backcolor Darkcyan" ' Assign a position Print #main.g, "Place 100 50" ' Write the directions Print #main.g, "\\Left Button Up - Fills Yellow" Print #main.g, "\\Right Button Up - Fills Green" ' Preserve the graphics Print #main.g, "Flush" ' Await the user's next move Wait
[EndDemo] Close #main End
[ButtonLeftUp] ' Clear the graphicbox and clear memory Print #main.g, "Cls" ' Fill the graphicbox with the color Yellow Print #main.g, "Fill Yellow" ' Assign the pen color as Darkblue Print #main.g, "Color Darkblue" ' Assign the backcolor as Yellow Print #main.g, "Backcolor Yellow" ' Place the pen Print #main.g, "Place 100 50" ' Write the directions Print #main.g, "\\Left Button Up - Fills Yellow" Print #main.g, "\\Right Button Up - Fills Green" ' Preserve the graphics Print #main.g, "Flush" ' Await the user's next move Wait
[ButtonRightUp] ' Clear the graphicbox and clear memory Print #main.g, "Cls" ' Fill the graphicbox with the color Green Print #main.g, "Fill Green" ' Assign the pen color as Darkblue Print #main.g, "Color Darkblue" ' Assign the backcolor as Green Print #main.g, "Backcolor Green" ' Place the pen Print #main.g, "Place 100 50" ' Write the directions Print #main.g, "\\Left Button Up - Fills Yellow" Print #main.g, "\\Right Button Up - Fills Green" ' Preserve the graphics Print #main.g, "Flush" ' Await the user's next move Wait
|
|
|
Post by regoroxford on Aug 24, 2018 16:25:35 GMT -5
Rod,
I was expecting to get an email notice as in the past.
My problem was how to include the feature in Liberty Basic.
I'll copy your examples and get familiar.
Thank you,
Roger
|
|