How do I get the text to change? - processing

I'm currently doing an assignment using processing, and I can't seem to figure out how to change the text.
The assignment basically revolves around a kite that moves, and after each 'step' that it we make, the next 'step' should appear. E.g. i am to provide a screen that resembles a rooftop at the bottom of the screen with an electric pole to the left. As the code runs, there is no kite, but as i click and then drag it'll appear.
So i guess after each movement that happens, the text at the bottom of the scgreen should update with the next step.
The text goes from: “Press, then drag, the mouse in the brown area (rooftop) to begin” to “Drag and then release in the blue area (sky)” and so forth
Thanks guys

I don't understand the third paragraph, but I'm assuming you want text to appear after the mouse is released
You can use mouseReleased() to generate the text at mouse position when the mouse is released
void mouseReleased () {
text("Press, then drag, the mouse in the brown area (rooftop) to begin” to “Press, then drag, the mouse in the brown area (rooftop) to begin", mouseX, mouseY)
}

Related

How do you update all the TreeView items full area when the vertical scrollbar shows up or goes away?

I am using NM_CUSTOMDRAW to draw tree view items. My items right justify parts of it by using a right margin based on the RECT area reported available. The issue I have is that when the vertical scrollbar appears or disappears, only the item expanded/collapsed and the area under the scrollbar seems to update (invalidated regions). This causes the repaint requests (with the new width) to not update the area correctly.
For example (using text and a single space as example): You could have something with the scrollbar be right justified text ## where ## is the scrollbar then when the scrollbar goes away you end up with right justified text t instead of right justified text
Is there a good way to fix this?
One thought is if I could catch a message when a scrollbar shows up or goes away, I could just invalidate the window to force a redraw. Is there such a message?
Or is there a way to add to the invalidated region without triggering a redraw loop but would update the full items area?
Another thought is I can just use the full window RECT size and use a right margin large enough that wouldn't be under the scroll area but I'd rather not do that.
Thanks!

How to add positioning animation onstart in figma?

I have a rectangle in figma and I want to give it a positioning animation from top to bottom on starting the page. (without clicking or hovering) How is it possible?
At the moment, the best way to animate in Figma is using a combination of Smart Animate & After Delay between two frames.
On Run Animation
We're going to create a start & end frame. Then, animate between them.
Create your starting frame with your rectangle in its starting position.
Rename the rectangle layer to something unique. This ensure the layer doesn't get missed with the Smart Animate function if the frame gets any busier with more layers.
Duplicate your frame CMD+D and position your rectangle to its end position (Check that Figma hasn't renamed your rectangle)
Click Prototype in the top right corner of your panel.
Select your starting frame & click the None dropdown & select After Delay
Click the None dropdown and select Navigate To from the list
In the dropdown the appears to the right, select your ending frame from the list
Under Animation, click the dropdown and select Smart Animate
Deselect your frame and ensure that the "Starting Frame" is set to your first frame.
Finally, hit play in the top right and watch the magic!
Hope this helps!
And here's a screenshot of the set up.
Hope this is what you were after!

Three JS add/remove a event in mousedown

In three JavaSript, I have to remove the event once I clicked on a cube and dragged i to another cube. Say, my concern is once I click on the cube and drag my mouse pointer it create a line where when I click on the another cue the line draws continuously without staying at the particular cube . Check the comment for fiddle url.

Move a div up and down based on mouse Move

I have this aside element which is has a position:fixed; property. Inside it, i have another div.inner which will hold elements which might be many and therefore might exceed the window.height();
Now, i need to solve this problem based on mouse scroll event on the div.inner element. I need to move the inner div top or down based on mouse scroll up or down events.
Please have a look at this website which demonstrates exactly what i need on the left were they have the logo and menus. Try moving your mouse up or down on that element and see.
Here is my attempt which didn't go so well.
Im not gonna write the entire code, but the concept from the page is:
pageHeigth = 200px
menuHeight = 250px
menuOverflow = menuHeight - pageHeight (50px)
Mouse positioned at the top: Menu CSS = "top:0px"
Mouse positioned at the bottom: Menu CSS = "top:-50px" (negative menuOverflow)
And of course interpolate the postion between top/bottom depending on mouse position. And also, using the terminology "mouse scroll" in your question makes it ambigous to understand, i believe "mouse move" is a better wording. "Scroll" makes me think about mousewheel or the page scrolling

VSTO in Powerpoint: Changing custom task pane visibility in WindowSelectionChange moves selected shape

I think I have found a bug.
I am developing a add-in for Powerpoint 2010. The event WindowSelectionChange is fired when a shape (e.g. a picture) is selected/deselected.
However, if I use this event to change the Visibility property of a Custom Task Pane, then the shape moves left/right on the slide. Example:
Private Sub Application_WindowSelectionChange(Sel As Microsoft.Office.Interop.PowerPoint.Selection) Handles Application.WindowSelectionChange
cTaskPane.Visible = Not cTaskPane.Visible
End Sub
I have tried to monitor the Left property of the shape, and that does not change from the beginning to the end of the WindowSelectionChange sub. Thus, it must happen afterwards.
How can I avoid this?
Any workaround?
It's because your mouse is holding the shape, and the shape gets moved to the right when the window is shrunk.
In more detail, the moving occurs in 4 steps:
You press mouse, caused window selection change, then the pane becomes visible, which makes the slide view window shrink;
Since the slide view window shrunk while your mouse's position remains to be the same, your mouse is moved right w.r.t the slide;
Since your mouse is pressing, the shape is anchored with your mouse, thus move to the current position of the mouse;
When pane becomes invisible again, the slide view window changes its size back, the shape is moving accordingly again.
To avoid this, I suggest you use WindowSelectionChange event and check if the selection is shape (code is in c#):
private void WindowSelectionChangedHandler(PowerPoint.Selection selection)
{
if (selection.Type == PowerPoint.PpSelectionType.ppSelectionShapes)
{
//do your stuff
}
}

Resources