要能够动态地挑选符号的多种颜色/设计从Flash的最佳方法符号、多种、颜色、方法

2023-09-08 14:43:27 作者:花前痛饮/月下小酌

抱歉标题是如此令人费解......我肯定尝试过了十分钟,以获得良好的,描述性标题!基本上,这里的场景。

Sorry the title's so convoluted... I must've tried for ten minutes to get a good, descriptive title! Basically, here's the scenario.

让我们假设一个用户可以挑选五十种不同的帽子的颜色和样式放在一个化身。该头像可以移动他的头左右,所以我们需要在何时发生这种情况符号相同类型的运动。

Let's say a user can pick fifty different hat colors and styles to put on an avatar. The avatar can move his head around, so we'd need the same types of movements in the symbol for when that happens.

此外,它获取该帽应该是对从一个数据库中的化身。问题是,我们不能仅仅拥有50种不同的帧与不同的帽子上的每个。而每顶帽子符号将具有同样的动作,这将只是不同的风格,颜色和大小。

Additionally, it gets which hat should be on the 'avatar' from a database. The problem is that we can't just make 50 different frames with a different hat on each. And each hat symbol will have the same movements, it'll just be different styles, colors and sizes.

所以,我怎样才能使一个变量是这样的帽子,这样我们就可以把适当的帽子象征注入变量,随时都可以打电话给Hat.gotoAndplay('tip_hat)或任何其他通用功能... 。 那有意义吗?

So how can I make one variable that is the HAT, that way we can just put the appropriate hat symbol into the variable and always be able to call Hat.gotoAndplay('tip_hat') or any other generic functions.... Does that make sense?

希望这不是太混乱。对不起,我不是伟大的视觉闪光的东西,但它得做!谢谢!

Hope that's not too confusing. Sorry, I'm not great at the visual Flash stuff, but it's gotta be done! Thanks!

推荐答案

debu's大约一个帽子容器建议的有意义的,以便分离出帽运动的控制。

debu's suggestion about a hat container makes sense in order to separate out control of the hat movement.

您可以进一步借此由分离出的每个帽(不只是颜色,而且样式,图案,尺寸,方向等)的外观的不同方面 - 这将允许从刚刚产生各种各样不同的帽子的一些参数。

You could take this further by separating out different aspects of the appearance of each hat (not just the colours, but also style, pattern, size, orientation etc) - this would allow you produce a wide variety of different hats from just a few parameters.

因此​​,例如,6样式×4模式x 8色= 192个不同的帽子(无需绘制每一个!)

So for example 6 styles x 4 patterns x 8 colours = 192 different hats (without having to draw each one!)

 
精彩推荐
图片推荐