Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - UBERmonkeybot

#21
Hi,
I wonder if someone could tell me how to output .dbg() to STDOUT.
I am wanting to send it to android monitor for debugging purposes.

Thanks in advance
#22
GLBasic - en / No serial
2015-Oct-01
 I Paid for glb on the 27th and still have not received a serial.I have emailed the forum help and the email address on the PayPal account but still haven't heard anything...boohoo I want to play  :(
#23
when i try to run in a browser i get this

Cannot enlarge memory arrays. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value 16777216, (2) compile with ALLOW_MEMORY_GROWTH which adjusts the size at runtime but prevents some optimizations, or (3) set Module.TOTAL_MEMORY before the program runs.


Could anyone tell me what's going on here and how i can remedy it.
Thanks

M
#24
I don't know if this is a bug or not but...

Right click on taskbar icon only list certain files in V14,Except for a couple of programs i have downloaded from the website.
In V12 it lists all last used files.
#25
Hi,
When i run the following code i am consistenly getting values in  xx and yy outside -1 to 1 how can this be possible?

Prob me being stupid again.


Thanks in advance.

Code (glbasic) Select

REPEAT

LOCAL xx#,yy#,b

FOR i=0 TO GETNUMJOYSTICKS()-1
xx#=GETJOYX(i)
yy#=GETJOYY(i)
b=GETJOYBUTTON(i,0)


IF xx#<-0.991 THEN xx#=-1
IF xx#> 0.991 THEN xx#= 1
IF yy#<-0.991 THEN yy#=-1
IF yy#> 0.991 THEN yy#= 1
DEBUG "\ni "+i+" xx "+xx#

NEXT
PRINT "Joytest",100,100
SHOWSCREEN



UNTIL FALSE
#26
GLBasic - en / Mem2Sprite
2015-Aug-31
Could someone please cast their eye over this,
I don't understand why this doesn't draw a green square.

Thanks

Code (glbasic) Select

GLOBAL   single%[]//[15]

GLOBAL w=16,h=16
DIM single%[w*h]

GLOBAL test2%
test2%=GENSPRITE()


FOR y=0 TO h-1
FOR x=0 TO w-1

single[x+(y*w)]=INTEGER(0xff00ff00)
DEBUG "\n"+x+" "+y+" "+HEX$(single[x+(y*w)])
// BREAK

NEXT
NEXT


LOCAL u


test2%=MEM2SPRITE(single%[],test2%,w,h)
IF test2%=0
DEBUG "\ntest2%=0  MEM2SPRITE FAILED"
END
ENDIF


DEBUG "\ntest2%= "+test2%
PRINT test2%,100,80

DRAWSPRITE test2%,100,100
SHOWSCREEN
MOUSEWAIT
#27




I cannot get prescaler to work reliably.I cannot increase screen by 2

e.g.

Game screen is @ 1280x800
Prescaler 2560,1600

so its 2 x  the original but is the size of the original
if i multiply by 1.5 then you can visually see that it is different.

I have read somewhere else that this may be a bug so have started a thread on it.

Anyone else experiencing weirdness,if not i will post my code
#28
This might be more of a configuration issue but I can't compile for android.

It fails just before stage 4.
I have installed the Android Target.
:|


_______________________________________
*** Configuration: ANDROID ***
precompiling:
GPC - GLBasic Precompiler V.10.037 SN:4bbcff56 - 2D, WIN32
Wordcount:40 commands
compile+link:

running glb_build.bat
Using ANDROID_TARGET="android-22"
You can use "C:\Users\PC\Desktop\glbasic\stuff\GLBasic\my stuff\GLBasic\prescaler 1\distribute\Android\glb_android_build.bat" to change the API level and SDK path.
ECHO is off.
androidmanifest.xml:
Make sure to check do a manual check for those.
android:minSdkVersion="10" android:targetSdkVersion="22"
ECHO is off.

AndroidIcons.exe [v21-3-2015] running...
copy C:/Users/PC/Desktop/glbasic/stuff/GLBasic/my stuff/GLBasic/prescaler 1/icon_36_AndroidExtras.png to C:/Users/PC/Desktop/glbasic/stuff/GLBasic/my stuff/GLBasic/prescaler 1/distribute/Android/res/drawable-ldpi/icon.png
copy C:/Users/PC/Desktop/glbasic/stuff/GLBasic/my stuff/GLBasic/prescaler 1/icon_48_AndroidExtras.png to C:/Users/PC/Desktop/glbasic/stuff/GLBasic/my stuff/GLBasic/prescaler 1/distribute/Android/res/drawable-mdpi/icon.png
copy C:/Users/PC/Desktop/glbasic/stuff/GLBasic/my stuff/GLBasic/prescaler 1/icon_72_AndroidExtras.png to C:/Users/PC/Desktop/glbasic/stuff/GLBasic/my stuff/GLBasic/prescaler 1/distribute/Android/res/drawable/icon.png
copy C:/Users/PC/Desktop/glbasic/stuff/GLBasic/my stuff/GLBasic/prescaler 1/icon_72_AndroidExtras.png to C:/Users/PC/Desktop/glbasic/stuff/GLBasic/my stuff/GLBasic/prescaler 1/distribute/Android/res/drawable-hdpi/icon.png
copy C:/Users/PC/Desktop/glbasic/stuff/GLBasic/my stuff/GLBasic/prescaler 1/icon_96_AndroidExtras.png to C:/Users/PC/Desktop/glbasic/stuff/GLBasic/my stuff/GLBasic/prescaler 1/distribute/Android/res/drawable-xhdpi/icon.png
copy C:/Users/PC/Desktop/glbasic/stuff/GLBasic/my stuff/GLBasic/prescaler 1/icon_180_AndroidExtras.png to C:/Users/PC/Desktop/glbasic/stuff/GLBasic/my stuff/GLBasic/prescaler 1/distribute/Android/res/drawable-xxhdpi/icon.png
copy C:/Users/PC/Desktop/glbasic/stuff/GLBasic/my stuff/GLBasic/prescaler 1/icon_192_AndroidExtras.png to C:/Users/PC/Desktop/glbasic/stuff/GLBasic/my stuff/GLBasic/prescaler 1/distribute/Android/res/drawable-xxxhdpi/icon.png
C:/Users/PC/Desktop/glbasic/stuff/GLBasic/my stuff/GLBasic/prescaler 1/icon_ouya_AndroidExtras.png is missing (732x412 size)
the Ouya icon is not important, if you dont want to support the console
copy C:/Users/PC/Desktop/glbasic/stuff/GLBasic/my stuff/GLBasic/prescaler 1/icon_ouya_AndroidExtras.png to C:/Users/PC/Desktop/glbasic/stuff/GLBasic/my stuff/GLBasic/prescaler 1/distribute/Android/res/drawable-xhdpi/ouya_icon.png

Checked AdActivity (intersititals):
Does not uses a AdActivity

Android Extras version (SDLActivity.java):
* 2.11.2

Checking Icons Finished...

BUILD STAGE 2: Start compiler (android.bat)
SDK=R:\Compiler\platform\android\bin\..\android-sdk-windows
Updated project.properties
Updated local.properties
Updated file C:\Users\PC\Desktop\glbasic\stuff\GLBasic\my stuff\GLBasic\prescaler 1\distribute\Android\build.xml
Updated file C:\Users\PC\Desktop\glbasic\stuff\GLBasic\my stuff\GLBasic\prescaler 1\distribute\Android\proguard-project.txt
Updated project.properties
Updated local.properties
Updated file C:\Users\PC\Desktop\glbasic\stuff\GLBasic\my stuff\GLBasic\prescaler 1\distribute\Android\bin\build.xml
Updated file C:\Users\PC\Desktop\glbasic\stuff\GLBasic\my stuff\GLBasic\prescaler 1\distribute\Android\bin\proguard-project.txt
.
BUILD STAGE 3: Build a debug build
Buildfile: C:\Users\PC\Desktop\glbasic\stuff\GLBasic\my stuff\GLBasic\prescaler 1\distribute\Android\build.xml

-set-mode-check:

-set-debug-files:

-check-env:
[checkenv] Android SDK Tools Revision 24.2.0
[checkenv] Installed at R:\Compiler\platform\android\android-sdk-windows

-setup:
     [echo] Project Name: glbasic
  [gettype] Project Type: Application

-set-debug-mode:

-debug-obfuscation-check:

-pre-build:

-build-setup:
[getbuildtools] Using latest Build Tools: 21.1.2
     [echo] Resolving Build Target for glbasic...
[gettarget] Project Target:   Android 5.1.1
[gettarget] API level:        22
     [echo] ----------
     [echo] Creating output directories if needed...
    [mkdir] Created dir: C:\Users\PC\Desktop\glbasic\stuff\GLBasic\my stuff\GLBasic\prescaler 1\distribute\Android\bin\rsObj
    [mkdir] Created dir: C:\Users\PC\Desktop\glbasic\stuff\GLBasic\my stuff\GLBasic\prescaler 1\distribute\Android\bin\rsLibs
     [echo] ----------
     [echo] Resolving Dependencies for glbasic...
[dependency] Library dependencies:
[dependency] No Libraries
[dependency]
[dependency] ------------------
     [echo] ----------
     [echo] Building Libraries with 'debug'...
   [subant] No sub-builds to iterate on

-code-gen:
[mergemanifest] Found Deleted Target File
[mergemanifest] Merging AndroidManifest files into one.
[mergemanifest] Manifest merger disabled. Using project manifest only.
     [echo] Handling aidl files...
     [aidl] No AIDL files to compile.
     [echo] ----------
     [echo] Handling RenderScript files...
     [echo] ----------
     [echo] Handling Resources...
     [aapt] Found Deleted Target File
     [aapt] Generating resource IDs...
     [echo] ----------
     [echo] Handling BuildConfig class...
[buildconfig] Generating BuildConfig class.

-pre-compile:

-compile:
    [javac] Compiling 12 source files to C:\Users\PC\Desktop\glbasic\stuff\GLBasic\my stuff\GLBasic\prescaler 1\distribute\Android\bin\classes
    [javac] warning: [options] source value 1.5 is obsolete and will be removed in a future release
    [javac] warning: [options] target value 1.5 is obsolete and will be removed in a future release
    [javac] warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
    [javac] Note: Some input files use or override a deprecated API.
    [javac] Note: Recompile with -Xlint:deprecation for details.
    [javac] 3 warnings

-post-compile:

-obfuscate:

-dex:
      [dex] input: C:\Users\PC\Desktop\glbasic\stuff\GLBasic\my stuff\GLBasic\prescaler 1\distribute\Android\bin\classes
      [dex] input: C:\Users\PC\Desktop\glbasic\stuff\GLBasic\my stuff\GLBasic\prescaler 1\distribute\Android\libs\android-support-v4.jar
      [dex] input: C:\Users\PC\Desktop\glbasic\stuff\GLBasic\my stuff\GLBasic\prescaler 1\distribute\Android\libs\gson-2.2.2.jar
      [dex] input: C:\Users\PC\Desktop\glbasic\stuff\GLBasic\my stuff\GLBasic\prescaler 1\distribute\Android\libs\ouya-sdk.jar
      [dex] input: C:\Users\PC\Desktop\glbasic\stuff\GLBasic\my stuff\GLBasic\prescaler 1\distribute\Android\libs\openiab-0.9.7.2.jar
      [dex] Pre-Dexing C:\Users\PC\Desktop\glbasic\stuff\GLBasic\my stuff\GLBasic\prescaler 1\distribute\Android\libs\android-support-v4.jar -> android-support-v4-afcb4d4dba3f9c2bacb9aaeb23ada72b.jar

BUILD FAILED
R:\Compiler\platform\android\android-sdk-windows\tools\ant\build.xml:892: The following error occurred while executing this line:
R:\Compiler\platform\android\android-sdk-windows\tools\ant\build.xml:894: The following error occurred while executing this line:
R:\Compiler\platform\android\android-sdk-windows\tools\ant\build.xml:906: The following error occurred while executing this line:
R:\Compiler\platform\android\android-sdk-windows\tools\ant\build.xml:283: null returned: 1


Total time: 2 seconds
.
BUILD STAGE 4: Build a release build
   [subant] No sub-builds to iterate on
    [javac] warning: [options] source value 1.5 is obsolete and will be removed in a future release
    [javac] warning: [options] target value 1.5 is obsolete and will be removed in a future release
    [javac] warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
    [javac] Note: Some input files use or override a deprecated API.
    [javac] Note: Recompile with -Xlint:deprecation for details.
    [javac] 3 warnings

BUILD FAILED
R:\Compiler\platform\android\android-sdk-windows\tools\ant\build.xml:892: The following error occurred while executing this line:
R:\Compiler\platform\android\android-sdk-windows\tools\ant\build.xml:894: The following error occurred while executing this line:
R:\Compiler\platform\android\android-sdk-windows\tools\ant\build.xml:906: The following error occurred while executing this line:
R:\Compiler\platform\android\android-sdk-windows\tools\ant\build.xml:283: null returned: 1

Total time: 1 second
Picked up _JAVA_OPTIONS: -Xms256m -Xmx512m
.
#29
Hi SuperKnowledgabelForumPeeps.

Noob question 40092

I have compiled my game to android to find it is running really slowly compared to windows,I think it is down to my polyvector stretch from 1280 x 800 to the resolution on my tablet (Galaxy S4 2560 x 1600).
From what i have read it would appear that i have to re-scale my graphics and game coords for each and every resolution,Is this really the case?
It seems rather mad that i can't just change the resolution on the tablet especially seeing as it will be running full screen.
I do remember seeing a post with someone saying they just used the 3d commands in a 2d implementation anyone have any thoughts on this?

Thanks in advance.
#30
Hi all,
I have just discovered that Debug isn't working inside FOREACH loops.


Is this normal? :|
#31
Anyone else having this problem?

I seem to be getting a load of Java errors

compile:
    [javac] Compiling 17 source files to C:\Users\PC\Desktop\glbasic\stuff\GLBasic\my stuff\GLBasic\Jetpac\jetpac v2\distribute\Android\bin\classes
    [javac] warning: [options] source value 1.5 is obsolete and will be removed in a future release
    [javac] warning: [options] target value 1.5 is obsolete and will be removed in a future release
    [javac] warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
    [javac] C:\Users\PC\Desktop\glbasic\stuff\GLBasic\my stuff\GLBasic\Jetpac\jetpac v2\distribute\Android\src\com\glbasic\test\GameControllers.java:40: error: mSingleton has private access in SDLActivity
    [javac]       if (SDLActivity.mSingleton.isOuya) playerID=OuyaController.getPlayerNumByDeviceId(playerID);
    [javac]                      ^
    [javac] C:\Users\PC\Desktop\glbasic\stuff\GLBasic\my stuff\GLBasic\Jetpac\jetpac v2\distribute\Android\src\com\glbasic\test\GameControllers.java:40: error: cannot find symbol
    [javac]       if (SDLActivity.mSingleton.isOuya) playerID=OuyaController.getPlayerNumByDeviceId(playerID);
    [javac]                                 ^
    [javac]   symbol:   variable isOuya
    [javac]   location: variable mSingleton of type SDLActivity
    [javac] C:\Users\PC\Desktop\glbasic\stuff\GLBasic\my stuff\GLBasic\Jetpac\jetpac v2\distribute\Android\src\com\glbasic\test\GameControllers.java:40: error: illegal start of type
    [javac]       if (SDLActivity.mSingleton.isOuya) playerID=OuyaController.getPlayerNumByDeviceId(playerID);
    [javac]          ^
    [javac] C:\Users\PC\Desktop\glbasic\stuff\GLBasic\my stuff\GLBasic\Jetpac\jetpac v2\distribute\Android\src\com\glbasic\test\Shop.java:375: error: cannot find symbol
    [javac]          base64EncodedPublicKey=SDLActivity.getStringResourceByName("com.google.play", "");
    [javac]                                            ^
    [javac]   symbol:   method getStringResourceByName(String,String)
    [javac]   location: class SDLActivity
    [javac] C:\Users\PC\Desktop\glbasic\stuff\GLBasic\my stuff\GLBasic\Jetpac\jetpac v2\distribute\Android\src\com\glbasic\test\Shop.java:380: error: cannot find symbol
    [javac]          SLIDEME=SDLActivity.getStringResourceByName("SlideME", "");
    [javac]                             ^
    [javac]   symbol:   method getStringResourceByName(String,String)
    [javac]   location: class SDLActivity
    [javac] C:\Users\PC\Desktop\glbasic\stuff\GLBasic\my stuff\GLBasic\Jetpac\jetpac v2\distribute\Android\src\com\glbasic\test\Shop.java:385: error: cannot find symbol
    [javac]          APPLAND_PUBLIC_KEY=SDLActivity.getStringResourceByName("Appland", "");
    [javac]                                        ^
    [javac]   symbol:   method getStringResourceByName(String,String)
    [javac]   location: class SDLActivity
    [javac] Note: Some input files use or override a deprecated API.
    [javac] Note: Recompile with -Xlint:deprecation for details.
    [javac] 6 errors
    [javac] 3 warnings

BUILD FAILED
Q:\Compiler\platform\android\android-sdk-windows\tools\ant\build.xml:720: The following error occurred while executing this line:
Q:\Compiler\platform\android\android-sdk-windows\tools\ant\build.xml:734: Compile failed; see the compiler error output for details.

Total time: 1 second
.
BUILD STAGE 4: Build a release build
   [subant] No sub-builds to iterate on
    [javac] warning: [options] source value 1.5 is obsolete and will be removed in a future release
    [javac] warning: [options] target value 1.5 is obsolete and will be removed in a future release
    [javac] warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
    [javac] C:\Users\PC\Desktop\glbasic\stuff\GLBasic\my stuff\GLBasic\Jetpac\jetpac v2\distribute\Android\src\com\glbasic\test\GameControllers.java:40: error: mSingleton has private access in SDLActivity
    [javac]       if (SDLActivity.mSingleton.isOuya) playerID=OuyaController.getPlayerNumByDeviceId(playerID);
    [javac]                      ^
    [javac] C:\Users\PC\Desktop\glbasic\stuff\GLBasic\my stuff\GLBasic\Jetpac\jetpac v2\distribute\Android\src\com\glbasic\test\GameControllers.java:40: error: cannot find symbol
    [javac]       if (SDLActivity.mSingleton.isOuya) playerID=OuyaController.getPlayerNumByDeviceId(playerID);
    [javac]                                 ^
    [javac]   symbol:   variable isOuya
    [javac]   location: variable mSingleton of type SDLActivity
    [javac] C:\Users\PC\Desktop\glbasic\stuff\GLBasic\my stuff\GLBasic\Jetpac\jetpac v2\distribute\Android\src\com\glbasic\test\GameControllers.java:40: error: illegal start of type
    [javac]       if (SDLActivity.mSingleton.isOuya) playerID=OuyaController.getPlayerNumByDeviceId(playerID);
    [javac]          ^
    [javac] C:\Users\PC\Desktop\glbasic\stuff\GLBasic\my stuff\GLBasic\Jetpac\jetpac v2\distribute\Android\src\com\glbasic\test\Shop.java:375: error: cannot find symbol
    [javac]          base64EncodedPublicKey=SDLActivity.getStringResourceByName("com.google.play", "");
    [javac]                                            ^
    [javac]   symbol:   method getStringResourceByName(String,String)
    [javac]   location: class SDLActivity
    [javac] C:\Users\PC\Desktop\glbasic\stuff\GLBasic\my stuff\GLBasic\Jetpac\jetpac v2\distribute\Android\src\com\glbasic\test\Shop.java:380: error: cannot find symbol
    [javac]          SLIDEME=SDLActivity.getStringResourceByName("SlideME", "");
    [javac]                             ^
    [javac]   symbol:   method getStringResourceByName(String,String)
    [javac]   location: class SDLActivity
    [javac] C:\Users\PC\Desktop\glbasic\stuff\GLBasic\my stuff\GLBasic\Jetpac\jetpac v2\distribute\Android\src\com\glbasic\test\Shop.java:385: error: cannot find symbol
    [javac]          APPLAND_PUBLIC_KEY=SDLActivity.getStringResourceByName("Appland", "");
    [javac]                                        ^
    [javac]   symbol:   method getStringResourceByName(String,String)
    [javac]   location: class SDLActivity
    [javac] Note: Some input files use or override a deprecated API.
    [javac] Note: Recompile with -Xlint:deprecation for details.
    [javac] 6 errors
    [javac] 3 warnings
#32
Hi All,
I have a prog running on Windows and also compiles to my phone(HTC one) with no probs,when i put it on my tablet(Galaxy Tab S 10.1) some of the graphics are corrupt,I assume that there are some files already on the Tablet that are not being written over.
I have searched for an answer and also tried to find the relevent files on my Tab.


Any ideas what i can do?

Thanks in advance.
#33
Hi,
I am a total NOOB at GLB,i have created a prog to bounce a ball round the  screen as a test,it runs fine in windows but when i compile it to Android i just get a block moving around inplace of the ball.
Does anyone have any ideas,I have read loads of stuff on the forum but still cant work out what is going on.



Code (glbasic) Select
// --------------------------------- //
// Project: bounce your balls
// Start: Saturday, June 20, 2015
// IDE Version: 12.312


// FREE-VERSION:
// Need Premium for Features:
// 3D Graphics
// Network Commands
// INLINE C/C+++ code

// SETCURRENTDIR("Media") // go to media files

TYPE tgame
sx
sy
ENDTYPE

GLOBAL game AS tgame

TYPE tc
x=100
y=200
xv#=1
yv#=1
ENDTYPE
GLOBAL c AS tc


GETSCREENSIZE game.sx,game.sy

GLOBAL progC=1
circle (20,20,20,10,0xff,0,0,0,1,0xff)
GLOBAL circSpr=1
GRABSPRITE circSpr,0,0,40,40

SETLOOPSUB  "MainLoop"


DEBUG "debug code"


FUNCTION logoscreen:
PRINT 200,200,"Bouncy balls"
SHOWSCREEN
ENDFUNCTION

FUNCTION Gameloop:
LOCAL x=200//RND(game.sx)
LOCAL y=200//RND(game.sy)
LOCAL rad=50//RND(50)
DRAWSPRITE circSpr,c.x,c.y
c.x#=c.x#+c.xv#
c.y#=c.y#+c.yv#
IF c.x#>game.sx-40 THEN c.xv#=-RND(10)
IF c.x#<0  THEN c.xv#=10
IF c.y#>game.sy-40 THEN c.yv#=-RND(10)
IF c.y#<0  THEN c.yv#=10
SHOWSCREEN
ENDFUNCTION


FUNCTION circle: xs,ys,r,s,c1,c2,c3,thickness,fill,fillCol

LOCAL a,cox#,coy#,cx#,cy#
cx#=COS(a)*r
cy#=SIN(a)*r
cox#=cx#
coy#=cy#
// DRAWLINE xs,ys,xs+10,ys,0xff0000
FOR rd#=r  TO r+thickness STEP 0.5
FOR a=0 TO 360 STEP s
cx#=COS(a)*rd#
cy#=SIN(a)*rd#
DRAWLINE xs+cx#,ys+cy#,xs+cox#,ys+coy#,RGB(c1,c2,c3)
cox=cx
coy=cy
NEXT
NEXT

//IF fill THEN FloodFill (xs,ys,fillCol)//,xs-(10),ys-(10),xs+(10),ys+(10),0)


ENDFUNCTION // CIRCLE



SUB MainLoop:
IF progC=0 THEN logoscreen ()
IF progC=1 THEN Gameloop()
ENDSUB





FUNCTION FloodFill: Pix_Num_X,Pix_Num_Y,fillcol%,screenx%=-1,screeny%=-1,width%=-1,height%=-1,Preview%=FALSE
//
// Pix_Num_X, Pix_Num_Y This the starting point to flood within the captured area of screen.
//                      These numbers are in relation to the sprite of the captured area, not the location of the pixel on the screen itself.
//
// fillcol              This is the fill color Floodfill will use to flood. The fill covers all pixels within the captured area which share the original color of
//                      the starting pix_num, and is limited by the edges of the captured area contained in the sprite, and will not cover other colors
//                      or jump lines across the captured area which have some other color.
//
// screenx,screeny      This is the optional starting x,y for the screen area capture. If no x,y is given, the default is (0,0), the upper left corner of the screen.
//
// width, height        This is the optional width and length of the screen capture. If no width or height is given, the ending screensize values are used, which is the lower right corner of the screen.
//
// Preview         When the optional Preview parameter is set for TRUE, the captured screen area is displayed against a grid background;
//                      and the selected starting pixel is set to black, unless the background is already black in which case it is set to white.
//                      As a single pixel is very small and hard to see, so you will have to look very closely to spot it.
//                       (Note: If Preview mode is used, ALL optional parameters must be used.)
//                      This mode is intended for programer use to check his or her screen capture area.
// ---------------------------------------------------------------------------------------------------------------------------------------
LOCAL id% = GENSPRITE()
LOCAL sw,sh
GETSCREENSIZE sw,sh
//Preview%=TRUE

// If default values are present, set them based on the screen size.

IF screenx < 2 THEN screenx=0
IF screeny < 2 THEN screeny = 0
IF width < 2 THEN width = sw-screenx
IF height < 2 THEN height = sh-screeny

// Errorcheck to avoid overrunning the limits of the screen
IF screenx+width > sw THEN width = sw-screenx
IF screeny+height > sh THEN height = sh-screeny

GRABSPRITE id%,screenx,screeny,width,height

IF Preview = TRUE

        LOCAL PixHold%

        CLEARSCREEN
        DRW_Grid() // Draws a gridwork on the background so the captured section of screen is easy to recognize.
        ALPHATESTING 1.0
        DRAWSPRITE id,screenx,screeny

        // Now we display the starting pixel in either black or white, depending on the background.

        PixHold = GETPIXEL (screenx+Pix_Num_X,screeny+Pix_Num_Y)
        IF PixHold = RGB(0,0,0)
                SETPIXEL screenx+Pix_Num_X,screeny+Pix_Num_Y, RGB(255,255,255)
        ELSE
                SETPIXEL screenx+Pix_Num_X,screeny+Pix_Num_Y, RGB(1,1,1)
        ENDIF
        SHOWSCREEN;     KEYWAIT
        ALPHATESTING 0.0
        SETPIXEL screenx+Pix_Num_X,screeny+Pix_Num_Y,PixHold // Here we restore the original color of the starting pixel for the flood fill to work on.

ENDIF

TYPE Fillpixel
        x%
        y%
ENDTYPE

GLOBAL pixels%[]


        LOCAL i[]  AS Fillpixel
        LOCAL newi AS Fillpixel
        LOCAL newx%,newy%,dir%
        LOCAL fillover%,fillcolour%
        LOCAL fillmap%[]
        LOCAL red%,green%,blue%,alpha%

        IF Pix_Num_X<0 OR Pix_Num_Y<0 OR Pix_Num_X>=width% OR Pix_Num_Y>=height
                DEBUG "Out of area."
                RETURN
        ENDIF

        SPRITE2MEM (pixels[],id)

        // Convert the fill colour to SPRITEMEM format.
         fillcolour=bOR(fillcol, ASL(255, 24))

        // Get the colour that will be filled over.
        red=bAND(pixels[Pix_Num_X+Pix_Num_Y*width%], 0xff)
        green=bAND(ASR(pixels[Pix_Num_X+Pix_Num_Y*width%],8), 0xff)
        blue=bAND(ASR(pixels[Pix_Num_X+Pix_Num_Y*width%],16), 0xff)
        alpha=bAND(ASR(pixels[Pix_Num_X+Pix_Num_Y*width%],24), 0xff)
        fillover=bOR(RGB(red,green,blue), ASL(alpha, 24))

        // If the fill pixel is same colour as then abort.
        IF fillover=fillcolour THEN RETURN

//      CLEARSCREEN;PRINT fillover+" "+fillcolour,50,50;SHOWSCREEN;KEYWAIT;END

        // Set the start position.
        newi.x=Pix_Num_X
        newi.y=Pix_Num_Y
        pixels[Pix_Num_X+Pix_Num_Y*width%]=fillcolour
        DIMPUSH i[],newi

        // Reset the fill check map.
        DIM fillmap[width%][height]
        fillmap[Pix_Num_X][Pix_Num_Y]=1

        FOREACH pixel IN i[]

                // New test position based on the direction.
                FOR dir=0 TO 3

                        SELECT dir

                        CASE 0                  // Right
                                newx=pixel.x+1
                                newy=pixel.y
                        CASE 1                  // Down
                                newx=pixel.x
                                newy=pixel.y+1
                        CASE 2                  // Left
                                newx=pixel.x-1
                                newy=pixel.y
                        CASE 3                  // Up
                                newx=pixel.x
                                newy=pixel.y-1
                        ENDSELECT


                        IF newx>=0 AND newy>=0 AND newx<width% AND newy<height  // Make sure the new position is in the boundaries of the screen/sprite.
                                IF fillmap[newx][newy]=0                                                        // If not already checked continue
                                        fillmap[newx][newy]=1                                                   // Flag this pixel as now checked
                                        IF pixels[newx+newy*width%]=fillover                    // Check pixel colour is the correct fill over colour.
                                                pixels[newx+newy*width%]=fillcolour                     // Fill and make a new pixel.
                                                newi.x=newx
                                                newi.y=newy
                                                DIMPUSH i[],newi
                                        ENDIF
                                ENDIF
                        ENDIF
                NEXT
                DELETE pixel                                                                            // Remove pixel from list
        NEXT
//
        MEM2SPRITE (pixels[],id,width%,height)
        DRAWSPRITE id,screenx,screeny//;USEASBMP;SHOWSCREEN;KEYWAIT

        DIM fillmap[0][0]
        RETURN id

ENDFUNCTION
// ------------------------------------------------------------- //
// ---  DRW_Grid  --- // Just Some Interesting Wallpaper.
// ------------------------------------------------------------- //
FUNCTION DRW_Grid:

// Red Grid Lines, for lay out. ///////////
CONSTANT RED% = RGB(255,0,0),GREY% = RGB(100,100,100)
LOCAL sw%,sh%
GETSCREENSIZE sw,sh
LOCAL cnt%,sw_Inc% = sw/32,sh_Inc%=sh/32
FOR cnt = -16 TO 16
        DRAWLINE sw/2-sw_Inc*cnt,0,sw/2-sw_Inc*cnt,sh,GREY
        DRAWLINE 0,sh/2-sh_Inc*cnt,sw,sh/2-sh_Inc*cnt,GREY
NEXT

DRAWLINE sw/2,0,sw/2,sh,RED
DRAWLINE 0,sh/2,sw,sh/2,RED

ENDFUNCTION // DRW_Grid