深度学习技巧

tech2024-05-30  74

深度学习技巧

I was rooting around in the Flash MX 2004′ sock drawer and stumbled across a rather nifty AS file (DepthControl.as) buried in the installation directory; a little further exploratory work and i was pleasantly surprised to find some very simple methods for depth shuffling (kinda cool if you’re into game or windowed application development).

我在Flash MX 2004的袜子抽屉中扎根,偶然发现了埋在安装目录中的一个漂亮的AS文件(DepthControl.as)。 进行了一些进一步的探索性工作,我惊喜地发现了一些非常简单的深度改写方法(如果您喜欢游戏或窗口式应用程序开发,那会很酷)。

Here’s the list of publically available functions for the class:

这是该类的公共可用功能的列表:

bringForward(target:MovieClip) sendBackward(target:MovieClip) bringToFront(target:MovieClip) sendToBack(target:MovieClip):Void

bringForward(target:MovieClip) sendBackward(target:MovieClip) bringToFront(target:MovieClip) sendToBack(target:MovieClip):Void

And having created a simple movie clip with a linkage identifier of depthTest, I added the following code to the first frame of the timeline allowing simple press-release functionality to the duplicated MCs on the stage

在创建了一个带有depthTest链接标识符的简单影片剪辑之后,我在时间轴的第一帧中添加了以下代码,从而为舞台上重复的MC提供了简单的新闻发布功能

for (i=0; i<15; i++) { duplicatemovieclip("depthtest", ["depthtest"+i], i+5); _root["depthtest"+i]._x="50+(i*10);" _root["depthtest"+i]._y="50+(i*10);" _root["depthtest"+i].onpress="function()" mx.behaviors.depthcontrol.bringforward(this); }; _root["depthtest"+i].onrelease="function()" mx.behaviors.depthcontrol.sendbackward(this); }< code>15;>

for (i=0; i<15; i++) { duplicatemovieclip("depthtest", ["depthtest"+i], i+5); _root["depthtest"+i]._x="50+(i*10);" _root["depthtest"+i]._y="50+(i*10);" _root["depthtest"+i].onpress="function()" mx.behaviors.depthcontrol.bringforward(this); }; _root["depthtest"+i].onrelease="function()" mx.behaviors.depthcontrol.sendbackward(this); }< code>15;>

Now when I need to include any depth manipulation in my applications, I can simply include the class and call the functions through the prototype chain!

现在,当我需要在应用程序中包括任何深度操作时,我只需包含类并通过原型链调用函数即可!

翻译自: https://www.sitepoint.com/quick-and-easy-depth-tricks/

深度学习技巧

最新回复(0)