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.


Messages - UBERmonkeybot

Pages: [1] 2 3 ... 16
1
Off Topic / Re: New ZX Machine
« on: 2017-Feb-28 »
They should have spelled it vaguer .

2
Announcements / Re: Useful freeware tools
« on: 2017-Feb-02 »
A very cool Web based SFX thing.

http://www.bfxr.net/

3
GLBasic - en / Re: about IOS & Android Updates
« on: 2017-Jan-31 »
Wow! 1.7m! Is that all with GLB code?

4
GLBasic - en / Re: about IOS & Android Updates
« on: 2017-Jan-30 »
Thanks for all you hard work SF. :good: :nw:

5
GLBasic - en / Re: GL ES
« on: 2017-Jan-17 »
I had a look at Regal and it completely bamboozled me. :S

6
GLBasic - en / Re: Help on a simple paint tool
« on: 2017-Jan-17 »
New version with a tweak for custom brushes.

Code: GLBasic [Select]
// --------------------------------- //
// Project: revealPainter
// Start: Thursday, January 12, 2017
// IDE Version: 14.497


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

GLOBAL brushW=14
GLOBAL brushH=7
GLOBAL brushStar[]
DIM brushStar[brushW*brushH]


//RESTORE square
RESTORE star
makeBrush(brushW,brushH)

SETSCREEN 800,600,0



SYSTEMPOINTER 1
GLOBAL array%[]
CONSTANT size=256
DIM array%[size*size]

GLOBAL back%=3000//GENSPRITE()


GLOBAL sc=5//GENSCREEN()
CREATESCREEN sc,back,size,size
USESCREEN sc
FOR q=0 TO 500
        DRAWRECT RND(size),RND(size),10+RND(40),10+RND(40),RND(0xffffff)
NEXT

USESCREEN -1
DRAWSPRITE back,100,100

        //IF
        SPRITE2MEM(array%[],back)

        GLOBAL newone%=2999//GENSPRITE()

        MEM2SPRITE(array%[],newone,size,size)


        LOCAL mx,my,b1,b2
        FOR a=0 TO (size*size)-1
                array%[a]=BAND(array%[a],0x00ffffff)
        NEXT
        LOCAL pos
        //LOCAL bs=10
        REPEAT
                MOUSESTATE mx,my,b1,b2
                IF mx>size-brushW THEN mx=size-brushW
                IF my>size-brushH THEN my=size-brushH
                IF mx<=0 THEN mx=0
                IF my<=0 THEN my=0
                IF b1
                        FOR h =0 TO brushH-1
                                FOR w=0 TO brushW-1
                                        IF queryBrush(w,h,brushW,brushH)=1                              //NEW BIT
                                                pos=(my+h)*size+(mx+w)
                                                array%[pos]=BOR(array%[pos],0xff000000)
                                        ENDIF
                                NEXT
                        NEXT
                ENDIF
                MEM2SPRITE(array%[],newone,size,size)

                DRAWRECT 0,0,size+2,size+2,0xffffff
                DRAWRECT 1,1,size,size,0


                DRAWSPRITE newone,1,1

                DRAWSPRITE back,size*1.2,2
                PRINT "DRAW WITH LEFT MB IN THE PANE",0,size*1.2
               
                showBrush(brushW,brushH,5)

                SHOWSCREEN
        UNTIL FALSE

MOUSEWAIT

FUNCTION makeBrush:w,h
        LOCAL b$,r$,c
        FOR y= 0 TO h-1
                READ r$
                FOR x=0 TO w-1
                        IF MID$(r$,x,1)="*" THEN brushStar[c]=1
                        INC c
                NEXT
        NEXT
ENDFUNCTION

FUNCTION showBrush:w,h,s
        LOCAL c
        FOR y= 0 TO h-1
                FOR x=0 TO w-1
                        IF  brushStar[c]=1 THEN DRAWRECT 400+(x*s),400+(y*s),s,s,0x00ff00
                        INC c
                NEXT
        NEXT
ENDFUNCTION

FUNCTION queryBrush:x,y,w,h

                        IF  brushStar[y*w+x]=1 THEN RETURN 1
ENDFUNCTION




STARTDATA square:
        DATA "**************"
        DATA "*            *"
        DATA "*            *"
        DATA "*            *"
        DATA "*            *"
        DATA "*            *"
        DATA "**************"                          
ENDDATA

STARTDATA star:
        DATA "      *       "
        DATA "     ***      "
        DATA "    *****     "
        DATA "************* "
        DATA " ***********  "
        DATA "   *******    "
        DATA "  ***   ***   "
        DATA " **       **  "

ENDDATA

 

7
GLBasic - en / Re: Help on a simple paint tool
« on: 2017-Jan-15 »
I will post a brush version soon but have been busy,you need to study up on logic gates and or xor, ery useful.
And binary math stuff.


8
GLBasic - en / Re: Help on a simple paint tool
« on: 2017-Jan-13 »
I would assume getpixel would be realllllllly slow because it is reading from video memory.

9
GLBasic - en / Re: Help on a simple paint tool
« on: 2017-Jan-12 »
You got my brain going.

Code: GLBasic [Select]
// --------------------------------- //
// Project: revealPainter
// Start: Thursday, January 12, 2017
// IDE Version: 14.497


// SETCURRENTDIR("Media") // go to media files
SYSTEMPOINTER 1
GLOBAL array%[]
CONSTANT size=128
DIM array%[size*size]

GLOBAL back%=3000//GENSPRITE()


GLOBAL sc=5//GENSCREEN()
CREATESCREEN sc,back,size,size
USESCREEN sc
FOR q=0 TO 500
        DRAWRECT RND(size),RND(size),10+RND(40),10+RND(40),RND(0xffffff)
NEXT

USESCREEN -1
DRAWSPRITE back,100,100

        //IF
        SPRITE2MEM(array%[],back)
       
        GLOBAL newone%=2999//GENSPRITE()

        MEM2SPRITE(array%[],newone,size,size)
       

        LOCAL mx,my,b1,b2
        FOR a=0 TO (size*size)-1
                array%[a]=BAND(array%[a],0x00ffffff)
        NEXT
        LOCAL pos
        LOCAL bs=10
        REPEAT
                MOUSESTATE mx,my,b1,b2
                IF mx>size-bs THEN mx=size-bs
                IF my>size-bs THEN my=size-bs
                IF mx<=0 THEN mx=0
                IF my<=0 THEN my=0
                IF b1
                        FOR h =0 TO bs-1
                                FOR w=0 TO bs-1
                                        //array[(my+h)*size+(mx+w)]=0x00000000
                                        pos=(my+h)*size+(mx+w)
                                        array%[pos]=BOR(array%[pos],0xff000000)
                                NEXT
                        NEXT
                ENDIF  
                MEM2SPRITE(array%[],newone,size,size)  
               
                DRAWRECT 0,0,size+2,size+2,0xffffff
                DRAWRECT 1,1,size,size,0
               
               
                DRAWSPRITE newone,1,1
       
                DRAWSPRITE back,size*1.2,2
                PRINT "DRAW WITH LEFT MB IN THE PANE",0,size*1.2
       
       
                SHOWSCREEN
        UNTIL FALSE

MOUSEWAIT
 

10
GLBasic - en / Re: Help on a simple paint tool
« on: 2017-Jan-11 »
Oh yeah sorry,I quickly scanned your message.

you could print your image then plot an array of black squares over it then delete them at cursor point  revealing the image underneath...
Unless i have totally misunderstood your request. :S

11
GLBasic - en / Re: Help on a simple paint tool
« on: 2017-Jan-11 »
Mem2sprite and sprittomem? Perhaps utilising the alpha channel.

12
Keep up the good work.
 :whip:

13
match the colours in as few goes as possible.



14
I have spent hours trying to work out why this is happening.

I have uninstalled Comodo and anything else i thought might be weirdly interacting with files.

Taken everything out of my startup,disabled all the services i could.

I have reverted to an older GLB 14.106

No change it appears to be entirely random and i cannot work out when or why it is happening,It looks like it might well be  a problem with my system and not  a GLB Bug.

It appears that if i don't try a compile for a few mins it works.

I am now totally out of ideas...

15
It isn't those commands it appears to be random,I have reverted to previous version.

Pages: [1] 2 3 ... 16