Mohannad
01-05-2006, 04:11 PM
السلام عليكم ورحمة الله بركاته ... اليوم رايح أعطيكم درس لبيان الحركة العمودية والأفقية للماوس في السويش ماكس ( تنفع في السويش2)
في المثال التالي حرك الماوس مرة أفقيا ومرة عموديا وشوف حركات الخطين .
width=400 height=284
فائدة هذا التصميم : تقدر تصنع منه مسطرة مثل المستطرة التي تشاهدها في السويش ماكس وذلك لقياس المسافات وتحديدها
1) ارسم خط أفقي وسميه line2 وخليه مفعل target
2) ارسم خط عمودي وسميه line1 وخيه مفعل target
ضع الكود التالي داخل script لـ scene
onEnterFrame() {
//This simulates the vertical line going up and down, without the need to:-)
line2._y = _root._ymouse;
//This siulates the horizontil line going from side to side, without it.
line1._x = _root._xmouse;
/*this hides the mouse, if you dont belive this is accurate remove this line
of code and see where the crosshairrs meet and where the cursor pointer is*/
mouse.hide();
}
في المثال التالي حرك الماوس مرة أفقيا ومرة عموديا وشوف حركات الخطين .
width=400 height=284
فائدة هذا التصميم : تقدر تصنع منه مسطرة مثل المستطرة التي تشاهدها في السويش ماكس وذلك لقياس المسافات وتحديدها
1) ارسم خط أفقي وسميه line2 وخليه مفعل target
2) ارسم خط عمودي وسميه line1 وخيه مفعل target
ضع الكود التالي داخل script لـ scene
onEnterFrame() {
//This simulates the vertical line going up and down, without the need to:-)
line2._y = _root._ymouse;
//This siulates the horizontil line going from side to side, without it.
line1._x = _root._xmouse;
/*this hides the mouse, if you dont belive this is accurate remove this line
of code and see where the crosshairrs meet and where the cursor pointer is*/
mouse.hide();
}