From: Ewan M. <mr...@mr...> - 2006-08-12 10:43:34
|
Hello, I need to use non-regular shapes for a number of buttons. Is the best way of doing so to subclass the NSButtonCell class, override the drawing functions and then use this in an extended NSButton class for each differently shaped button? Is there another way that is considered better practice? The buttons will be transparent and used as 'hotspots' on top of video. http://www.futilegames.org/ Cheers, Ewan |
From: Ray C. <rc...@gm...> - 2006-08-12 14:06:18
|
Hi, instead of looking for another method, you should concentrate on improving the subclassing method, because there is more than meets the eye. Look at NSCell.continueTrackingAtInView, where you can put more specific bounds-checking/hit-tests, instead of overriding trackMouseInRectOfViewUntilMouseUp. On 8/12/06, Ewan McDougall <mr...@mr...> wrote: > Hello, > > I need to use non-regular shapes for a number of buttons. Is the best > way of doing so to subclass the NSButtonCell class, override the > drawing functions and then use this in an extended NSButton class for > each differently shaped button? Is there another way that is > considered better practice? > > The buttons will be transparent and used as 'hotspots' on top of > video. http://www.futilegames.org/ > > Cheers, > > Ewan > > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > actionstep-core mailing list > act...@li... > https://lists.sourceforge.net/lists/listinfo/actionstep-core > -- Cheers, Ray Chuan |
From: Ewan M. <mr...@mr...> - 2006-08-14 20:57:02
|
Great, thanks for the advice, now all I need is a NSBezierPath to draw my shape and check if it contains the currentPoint ( of the mouse). I'll create a stub and implement the functions I need immediately, then after I've finished writing my app I can implement it fully. Has anybody started work on this yet? Cheers, Ewan On 12 Aug 2006, at 15:06, Ray Chuan wrote: > Hi, > instead of looking for another method, you should concentrate on > improving the subclassing method, because there is more than meets the > eye. > > Look at NSCell.continueTrackingAtInView, where you can put more > specific bounds-checking/hit-tests, instead of overriding > trackMouseInRectOfViewUntilMouseUp. > > On 8/12/06, Ewan McDougall <mr...@mr...> wrote: >> Hello, >> >> I need to use non-regular shapes for a number of buttons. Is the best >> way of doing so to subclass the NSButtonCell class, override the >> drawing functions and then use this in an extended NSButton class for >> each differently shaped button? Is there another way that is >> considered better practice? >> >> The buttons will be transparent and used as 'hotspots' on top of >> video. http://www.futilegames.org/ >> >> Cheers, >> >> Ewan >> >> >> --------------------------------------------------------------------- >> ---- >> Using Tomcat but need to do more? Need to support web services, >> security? >> Get stuff done quickly with pre-integrated technology to make your >> job easier >> Download IBM WebSphere Application Server v.1.0.1 based on Apache >> Geronimo >> http://sel.as-us.falkag.net/sel? >> cmd=lnk&kid=120709&bid=263057&dat=121642 >> _______________________________________________ >> actionstep-core mailing list >> act...@li... >> https://lists.sourceforge.net/lists/listinfo/actionstep-core >> > > > -- > Cheers, > Ray Chuan > > ---------------------------------------------------------------------- > --- > Using Tomcat but need to do more? Need to support web services, > security? > Get stuff done quickly with pre-integrated technology to make your > job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache > Geronimo > http://sel.as-us.falkag.net/sel? > cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > actionstep-core mailing list > act...@li... > https://lists.sourceforge.net/lists/listinfo/actionstep-core |
From: Scott H. <sc...@af...> - 2006-08-14 22:55:21
|
I actually have an idea for how this might be accomplished to make it a bit easier on you. What I would do is override createMovieClips() and create an additional shape movieclip to work with (using createBoundsMovieClip()). Look at how we override createMovieClips elsewhere to get a good impression of how this should work (look how the boolean return value is used). Be sure to set the "view" property of this shape movieclip to "this". Now, in drawRect() draw your irregular shape on the shape clip. Here's the interesting part. Override mouseDown() to check the event's "flashObject" property. This property is the MovieClip or TextField the mouse is currently over. If it isn't the shape MovieClip, return immediately. If it is, call super.mouseDown(). The only problem with this approach is that mouse tracking won't be constrained to the irregular area, but I imagine this probably isn't a huge problem. If it is, tell me and we can figure something out using this same approach, probably with a hitTest in an NSButtonCell subclass. Scott On 14/08/06, Ewan McDougall <mr...@mr...> wrote: > Great, > > thanks for the advice, now all I need is a NSBezierPath to draw my > shape and check if it contains the currentPoint ( of the mouse). I'll > create a stub and implement the functions I need immediately, then > after I've finished writing my app I can implement it fully. Has > anybody started work on this yet? > > Cheers, > > Ewan > > On 12 Aug 2006, at 15:06, Ray Chuan wrote: > > > Hi, > > instead of looking for another method, you should concentrate on > > improving the subclassing method, because there is more than meets the > > eye. > > > > Look at NSCell.continueTrackingAtInView, where you can put more > > specific bounds-checking/hit-tests, instead of overriding > > trackMouseInRectOfViewUntilMouseUp. > > > > On 8/12/06, Ewan McDougall <mr...@mr...> wrote: > >> Hello, > >> > >> I need to use non-regular shapes for a number of buttons. Is the best > >> way of doing so to subclass the NSButtonCell class, override the > >> drawing functions and then use this in an extended NSButton class for > >> each differently shaped button? Is there another way that is > >> considered better practice? > >> > >> The buttons will be transparent and used as 'hotspots' on top of > >> video. http://www.futilegames.org/ > >> > >> Cheers, > >> > >> Ewan > >> > >> > >> --------------------------------------------------------------------- > >> ---- > >> Using Tomcat but need to do more? Need to support web services, > >> security? > >> Get stuff done quickly with pre-integrated technology to make your > >> job easier > >> Download IBM WebSphere Application Server v.1.0.1 based on Apache > >> Geronimo > >> http://sel.as-us.falkag.net/sel? > >> cmd=lnk&kid=120709&bid=263057&dat=121642 > >> _______________________________________________ > >> actionstep-core mailing list > >> act...@li... > >> https://lists.sourceforge.net/lists/listinfo/actionstep-core > >> > > > > > > -- > > Cheers, > > Ray Chuan > > > > ---------------------------------------------------------------------- > > --- > > Using Tomcat but need to do more? Need to support web services, > > security? > > Get stuff done quickly with pre-integrated technology to make your > > job easier > > Download IBM WebSphere Application Server v.1.0.1 based on Apache > > Geronimo > > http://sel.as-us.falkag.net/sel? > > cmd=lnk&kid=120709&bid=263057&dat=121642 > > _______________________________________________ > > actionstep-core mailing list > > act...@li... > > https://lists.sourceforge.net/lists/listinfo/actionstep-core > > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > actionstep-core mailing list > act...@li... > https://lists.sourceforge.net/lists/listinfo/actionstep-core > |