TAILIEUCHUNG - Learning Flash CS4 Professional phần 8

Dòng 8 và 9 tạo ra một thể hiện của lớp IKMover, được thiết kế để di chuyển xương và cố gắng để di chuyển xương điểm (0, 0), hoặc góc trên bên trái của Stage. Bởi vì phần ứng được neo, nó không thể được di chuyển đến điểm (0, 0), và các dòng đó. Kết quả là nó kết thúc chỉ trong hướng đó. | Basic ActionScript Lines 8 and 9 create an instance of the IKMover class designed to move bones and attempt to move the bone to point 0 0 or the upper-left corner of the Stage. Because the armature is anchored it can t be moved to point 0 0 and strains to get there. The result is that it ends up pointing in that direction. You will initialize an armature in your portfolio project this way but the armature will be in a movie clip. As such the coordinates used will be easier to understand if they are translated from values relative to the movie clip to values relative to the Stage. To prepare for this adjustment see the Local and Global Coordinates sidebar next. WARNING The point used in the bone-moving script must be an instance of the Point class. You can t pass in separate x and y values. Local and Global Coordinates When working with display objects many properties and methods are dependant upon the scope or relative location to which the code applies. For example consider a movie clip with an instance name of mc an upper-left-corner registration point placed on the stage at an x coordinate of 20 and a y coordinate of 60 Figure 10-28 . point 0 0 global point -20 -60 local point 20 60 global point 0 0 local Figure 10-28. x and y coordinates relative to the stage global and a display object local From the Stage s perspective that movie clip is at point 20 60 and the upper-left corner of the stage is point 0 0 exactly as you d expect. However from the movie clip s perspective those points have different locations. The upper-left corner of the movie clip is no longer point 20 60 but rather point 0 0 because that position is now relative to the movie clip. Similarly the upper-left corner of the Stage isn t point 0 0 but is point -20 -60 instead. That is the movie clip remains at the origin of its perspective and the upper-left corner of the stage is 20 pixels to the left and 60 pixels up. On occasion you may need to refer to x and y coordinates in another scope. To do

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.