Jump to content

*EDIT* Figured it out* Color picker crosshair


You are about to reply to a thread that has been inactive for 2535 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

**Edit**

I think I figured out the solution I needed. I turned a square prim on its side and cut it to B = 0.375 and E = 0.625, so when the texture moves, all it sees is 1/4 of it, rather than the whole thing. (setting the repeats to something other than 1.0 doesn't work, it just throws off where the center should be)

 

I've seen some color pickers on huds that have an overlaid texture of a crosshair that moves with the mouse. I'm trying to figure out how to offset the texture as desired without the crosshair rolling over to the opposite side/corner. Any help?

Edited by Ruthven Willenov
Link to comment
Share on other sites

No, I got that figured out. It's the texture itself I'm having trouble with.

I  clicked on the bottom right of the color picker, but see how the crosshair rolls over to the other corners?

After giving it some thought, I don't think the solution would work, because then the vector returned would throw off the color desired. unless I need to do some math to figure that out?

Snapshot_001.png

Link to comment
Share on other sites

Well, the important part of the crosshair image is the dot at the center, and it isn't rolling over to the other corner.  If you don't want the rest of the crosshair image to roll over either, you'll have to change the scale of that texture, so that it is, say, 1.1 times the color picker image.  Then, yes, you'll have to do some math, but it shouldn't be hard.  You're matching the lower left corner of the color picker image with <0.05, 0.05> of the crosshair image, and the upper right corner with the crosshair's <0.95, 0.95>.  So, whatever position you read from the crosshair's point of view is actually at < x - 0.1, y - 0.1> * 1.1 from the color picker's point of view.  I think.

  • Like 1
Link to comment
Share on other sites

And of course, as I mentioned above, I was over thinking it. Instead of a targeting type cross-hair. I used what looks like just a plain 2 lines crossed. The texture is actually a solid alpha with an outline. When using vector touchST = llDetectedTouchST (and reversing with touchST = -touchST), the corners meet exactly where I'm touching, creating what looks like a cross-hair.

So I didn't have to scale, or do any math to offset accounting for it being scaled

Snapshot_002.png

Edited by Ruthven Willenov
  • Like 2
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 2535 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...