drawimage not working?

View: New views
6 Messages — Rating Filter:   Alert me  

drawimage not working?

by jfcwilson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi all,
 
While running some tests concerning a flashlight effect, I came across this:
When I try the code below, pipmak tells me that "drawimage" is not a valid method.
Anyone know what I(or Pipmak) am doing wrong?
 
Thanks a lot,
   James
CODE/
slide "light.jpg"
local darkLayer = patch { x = 0, y = 0, image = "dark.png" }
local flashlightmask = patch { x = 0, y = 0, image = "flashlightmask.png", visible=false }
hotspotmap "hotspotmap.png"
hotspot {
  onmousedown = function()
    darkLayer:drawimage (300, 200, flashlightmask)
  end
}
CODE\


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Pipmak-Users mailing list
Pipmak-Users@...
news://news.gmane.org/gmane.games.devel.pipmak.user
https://lists.sourceforge.net/lists/listinfo/pipmak-users

Re: drawimage not working?

by Christian Walther :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

James Wilson wrote:
> While running some tests concerning a flashlight effect, I came across this:
> When I try the code below, pipmak tells me that "drawimage" is not a
> valid method.

You're trying to call the "drawimage" method of a patch, but patches
don't have such a method. Images have one.

  -Christian


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Pipmak-Users mailing list
Pipmak-Users@...
news://news.gmane.org/gmane.games.devel.pipmak.user
https://lists.sourceforge.net/lists/listinfo/pipmak-users

Re: drawimage not working?

by jfcwilson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I see. How does one reference an image object again, to be used in this fashion?

--- On Sat, 10/31/09, Christian Walther <cwalther@...> wrote:

From: Christian Walther <cwalther@...>
Subject: Re: drawimage not working?
To: pipmak-users@...
Date: Saturday, October 31, 2009, 12:02 PM

James Wilson wrote:
> While running some tests concerning a flashlight effect, I came across this:
> When I try the code below, pipmak tells me that "drawimage" is not a
> valid method.

You're trying to call the "drawimage" method of a patch, but patches
don't have such a method. Images have one.

  -Christian


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Pipmak-Users mailing list
Pipmak-Users@...
news://news.gmane.org/gmane.games.devel.pipmak.user
https://lists.sourceforge.net/lists/listinfo/pipmak-users


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Pipmak-Users mailing list
Pipmak-Users@...
news://news.gmane.org/gmane.games.devel.pipmak.user
https://lists.sourceforge.net/lists/listinfo/pipmak-users

Re: drawimage not working?

by Christian Walther :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

James Wilson wrote:
> I see. How does one reference an image object again, to be used in this
> fashion?

pipmak.newimage() - see section 3.12 "Image Manipulation" in the manual.

  -Christian


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Pipmak-Users mailing list
Pipmak-Users@...
news://news.gmane.org/gmane.games.devel.pipmak.user
https://lists.sourceforge.net/lists/listinfo/pipmak-users

Re: drawimage not working?

by jfcwilson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I know. Sorry, but what I meant was how does one refer to that image object in code? The manual doesn't seem to make that clear.

--- On Sun, 11/1/09, Christian Walther <cwalther@...> wrote:

From: Christian Walther <cwalther@...>
Subject: Re: drawimage not working?
To: pipmak-users@...
Date: Sunday, November 1, 2009, 4:54 AM

James Wilson wrote:
> I see. How does one reference an image object again, to be used in this
> fashion?

pipmak.newimage() - see section 3.12 "Image Manipulation" in the manual.

  -Christian


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Pipmak-Users mailing list
Pipmak-Users@...
news://news.gmane.org/gmane.games.devel.pipmak.user
https://lists.sourceforge.net/lists/listinfo/pipmak-users


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Pipmak-Users mailing list
Pipmak-Users@...
news://news.gmane.org/gmane.games.devel.pipmak.user
https://lists.sourceforge.net/lists/listinfo/pipmak-users

Re: drawimage not working?

by Christian Walther :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

James Wilson wrote:
> I know. Sorry, but what I meant was how does one refer to that image
> object in code? The manual doesn't seem to make that clear.

I'm not sure I understand your question. The pipmak.newimage function
returns an image object that you can treat that like any other Lua value
- e.g. assign it to a variable, call methods on it, etc. - and use it
with any Pipmak functionality that accepts images.

For example,

   patch { x = 30, y = 80, image = pipmak.newimage(30, 20):color(1, 0,
0):fill() }

or

   local myimage = pipmak.newimage(30, 20)
   myimage:color(1, 0, 0)
   myimage:fill()
   mypatch:setimage(myimage)


Does that answer the question?

  -Christian


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Pipmak-Users mailing list
Pipmak-Users@...
news://news.gmane.org/gmane.games.devel.pipmak.user
https://lists.sourceforge.net/lists/listinfo/pipmak-users