If you're using the published outputs directly in your code, I'm not sure to
be honest, although I'd imagine it's exactly the same as sending values to
QC. Although how you bind a published output to a method I've no idea - it
must be covered in the docs somewhere.
If you justt need to bind it in interface builder, which is where I have
used it, you bind the published port to the value of something with patch
controller / patch / *.value as normal, and it's changed when the value in
QC changes - I use it to hide/show UI elements based on states within the
composition.
Chris


2009/1/12 Jonathan Selander <[email protected]>

> The expression works like magic! :)
>
> I have one last stupid question about this. I have now published the
> outputs of the expressions, but how can I read the values from the cocoa
> app? I suppose somehow using QCPatchController, but I only know how to set
> values, not how to retrieve them (maybe this is a question for cocoa-dev?)
>
>
> 12 jan 2009 kl. 13.30 skrev Chris Wood:
>
>
>  For hit testing, the hit area is normally:
>> x - (width / 2) to x + (width + 2)
>> y - (height / 2) to y + (height + 2)
>>
>> You can do the whole lot inside a single mathematical expression patch
>> with:
>>
>> (mouseX > (x - (width / 2))) && (mouseX < (x + (width / 2))) && (mouseY >
>> (y - (height / 2))) && (mouseY < (y + (height / 2)))
>>
>> Whether it's better to do it in QC or in your app depends on the case, but
>> QC is generally easier as the mouse coordinates are already converted for
>> you (i.e. the mouse position reported by the Mouse patch will match the
>> x/y/size coordinates on the billboards).
>>
>> Doing the actual handling of an interface or something in QC can be quite
>> a pain, as you're limited to javascript and a ton of wires, but it's easy
>> enough to hit test in QC and pass the result back to your cocoa app.
>>
>> Chris
>>
>>
>> 2009/1/12 Jonathan Selander <[email protected]>
>> Ahh, yes, of course. I'm still trying to figure out how to calculate the
>> position using the width. I underestand why it's 0-0.5 when it's at 0.5 and
>> 0.25 width, but with other examples I fail to get it right.
>>
>> I've got the width and X/Y positions defined outside the billboards
>> already, so I should be able to use some logic to get what I need.
>>
>> Do you think it's best to put this logic in the cocoa application or in
>> the quartz composition?
>>
>> /Jonathan
>>
>>
>> 12 jan 2009 kl. 11.26 skrev Chris Wood:
>>
>>
>> Jonathan,
>>
>> The image origin doesn't actually refer to the 'position on screen', it
>> refers to something more like the 'texture offset', which is sometimes
>> useful (and sometimes a real pain) when you're doing core image processing.
>> It generally doesn't affect the position you see the image, but if you're
>> doing things like adding one image over another image it can be important as
>> it affects the position there.
>>
>> The 'position on screen' will depend more on where you're telling it to
>> draw (as you have to give the sprite/billboard/etc. a position and a size
>> for it to draw), so you should actually already have the position. E.g. if
>> you have a billboard at position 0.25, 0.25 and size 0.5, 0.5 you just need
>> to test if the mouse is in the range x 0 to 0.5 on x and 0 to 0.5 on y.
>>
>> Let me know if you need help with something more specific.
>>
>> Chris
>>
>>
>> 2009/1/12 Jonathan Selander <[email protected]>
>> Hi, i'm trying to find where in the view an image is positioned, but image
>> origin always reports 0. I read in the doc that it's like this if the
>> dimensions are infinite, but what does that really mean?
>>
>> I'm trying to create a patch that determines whether or not the mouse
>> cursor is over the image.
>>
>> Thanks
>> _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> Quartzcomposer-dev mailing list      ([email protected])
>> Help/Unsubscribe/Update your Subscription:
>>
>> http://lists.apple.com/mailman/options/quartzcomposer-dev/psonice%40gmail.com
>>
>> This email sent to [email protected]
>>
>>
>>
>>
>
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to