Graphics question

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Graphics question

rob cranfill
I'm trying to get the hang of Plua graphics - very fun! - but 'fill'
isn't working for me, at least not the way I'd think it should (my
mistake, undoubtedly). Here's my code, which is supposed to create an
image that kinda looks like a partially-lit moon in the sky.

-- G2.lua
-- moon - for plua2

-- the sky (blue, not black)
ui.color(ui.rgb(0,0,128))
ui.box(0,0,200,200)

off=100 -- offset
w=ui.rgb(255,255,255)
b=ui.rgb(0,0,0)

-- the full disk, black
ui.color(b)
ui.disc(off,off,50,50)

-- a white ellipse in the middle
ui.color(w)
ui.disc(off,off,25,50)

-- fill the left-hand black area with white
ui.fill(2*off/3,off)

-- done
ui.event( )


Simple enough. Draws what I expect, except the "fill" just puts a fat
little dot where I'd like it to flood fill. I've also tried it
specifing the fill color, like

   ui.fill(2*off/3,off,w)

but that does the same.

Does ui.fill not work? Or work some other way?

Thanks for any hints,
   rob









 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/plua/

<*> To unsubscribe from this group, send an email to:
    [hidden email]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply | Threaded
Open this post in threaded view
|

Re: Graphics question

rob cranfill
Oh, yeah - I've tried it with Plua 1.1 and 2.0b4, same thing.
   - rob






 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/plua/

<*> To unsubscribe from this group, send an email to:
    [hidden email]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply | Threaded
Open this post in threaded view
|

Re: Graphics question

bh77a-2
In reply to this post by rob cranfill
Rob,

The code that you provide works properly on my TX.  Adding an
"os.sleep(5)" line before the fill allows for confirmation as well.  
This was tested with Plua 2.0b4.

Is it possible that you have an typo in the code on your Palm?
What type of Palm are you using it on?

Brian
On Mar 6, 2006, at 5:45 PM, rob cranfill wrote:

> I'm trying to get the hang of Plua graphics - very fun! - but 'fill'
> isn't working for me, at least not the way I'd think it should (my
> mistake, undoubtedly). Here's my code, which is supposed to create an
> image that kinda looks like a partially-lit moon in the sky.
>
> -- G2.lua
> -- moon - for plua2
>
> -- the sky (blue, not black)
> ui.color(ui.rgb(0,0,128))
> ui.box(0,0,200,200)
>
> off=100 -- offset
> w=ui.rgb(255,255,255)
> b=ui.rgb(0,0,0)
>
> -- the full disk, black
> ui.color(b)
> ui.disc(off,off,50,50)
>
> -- a white ellipse in the middle
> ui.color(w)
> ui.disc(off,off,25,50)
>
> -- fill the left-hand black area with white
> ui.fill(2*off/3,off)
>
> -- done
> ui.event( )
>
>
> Simple enough. Draws what I expect, except the "fill" just puts a fat
> little dot where I'd like it to flood fill. I've also tried it
> specifing the fill color, like
>
>    ui.fill(2*off/3,off,w)
>
> but that does the same.
>
> Does ui.fill not work? Or work some other way?
>
> Thanks for any hints,
>    rob
>
>
>
>
>
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
>
>
>



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/plua/

<*> To unsubscribe from this group, send an email to:
    [hidden email]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply | Threaded
Open this post in threaded view
|

Re: Graphics question

rob cranfill
--- In [hidden email], Brian Houghton <bh@...> wrote:

> Is it possible that you have an typo in the code on your Palm?
> What type of Palm are you using it on?
>

Dang. I pretty much copy/pasted that here, but I will take it back
into my machine for a test.

I have a Z22, so maybe it's a machine difference? Would someone else
who's got a Z22 like to test it?

- rob






 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/plua/

<*> To unsubscribe from this group, send an email to:
    [hidden email]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/