2016년 12월 4일 일요일

Moving label follow ball


Hi! I'm trying to complete Project Lead The Way's 1.2.5, part b under "Tasks Making a Larger Contribution". The problem is "Add a piece of text directly over the ball that counts milliseconds to add a feeling of rush to the game. This piece of text should stay in the same position relative to the ball regardless of where the ball moves. Now, I have figured out how to count the milliseconds using a label, but it needs to follow above a ball, which is rotating across the screen in a counter clockwise direction. If anyone could reply and show me how to make my label move with my ball, that would be great.

-- 
you might find some ideas after doing a search here in the forum or in Scott's Developers library here https://groups.google.com/forum/#!searchin/app-inventor-developers-library/sprite$20text%7Csort:relevance


-- 
☞ How to convert zip file into aia file

This technique of copying screens in an AI2 project uses Windows Explorer to add new screens to an AI2 project. 


When copying screens manually, be careful not to use keywords such as 'Button' for your new screen names as 'button' is one of the words used in component definitions in the screen files. Manually copying a screen named 'Button' will cause any button definitions to be corrupted by replacing 'button' with the new screen name and the new screen will not work. I add an SCR suffix to my screen names to insure that this does not happen. Alternatively you could make sure that you avoid those keywords.



Also, when copying screens from one project to another, be sure to also copy any assets needed by those screens from the source project to the destination project.

Screen CanvasSCR will be copied and named ClockSCR. I captured the screens for each step of the process below: 

Export your project to a folder on your computer.
Then place a copy of it with the original name in another folder for adding the new screen to.

Replace the aia extension on the copy's project name with a zip extension:

Open the project with Windows Explorer:
Navigate to the folder containing the screen files:
Drag the files with the screen name to be copied out of the archive:
-
Edit each file:
Replace all instances of the old screen name with the new screen name:
...then save each file.
Rename the Screen files to the new screen name:
Drag a copy of the the renamed screens to the archive:
Change the project extension back to aia:
When you import the project into AI2 it will contain the new screen. If you have an <old screen name>.Initialize block in the original screen it will now be named <new screen name>.Initialize in the copied screen.
-- 

댓글 없음:

댓글 쓰기