|  | 主题:  圆型的音量控制器做出来啦! | 
            
                        
                
                    |  5D精英
 职务:普通成员
 等级:3
 金币:10.0
 发贴:1340
 注册:2000/10/24 12:13:42
 
 | 
                            
                            #12000/11/7 14:02:14 
                                --lingo中我无法求反正切,只能做上下或左右拖动鼠标的旋钮啦。--将此行为赋予音量旋钮角色
 global soundposition
 on mousedown me
 if soundposition=void then soundposition=0
 --  如果要让鼠标在Y方向运动调节音量将 the mouseh 改为the mousev
 intX=the mouseh
 --  maxlengthofsound 是调节时鼠标的移动量,以像素为单位
 maxlengthofsound=300
 repeat while the mousedown
 X=the mouseh
 if (X-intX)<(maxlengthofsound-soundposition) and (intX-X)< soundposition then
 soundvalue=integer(255*(X-intx+soundposition)/maxlengthofsound)
 set the volume of sound 1 to soundvalue
 sprite(me.spritenum).rotation=360*(X-intx+soundposition)/maxlengthofsound
 position=X-intx+soundposition
 updatestage
 end if
 end repeat
 soundposition=position
 end
 
 | 
                        
                
                    |  Call Me Simon
 职务:普通成员
 等级:2
 金币:2.0
 发贴:646
 注册:2000/9/19 13:56:51
 
 | 
                            
                            #22000/11/7 14:19:47 
                                lingo里有反正切的函数 atan()
 另外Director里有这样一个behavior 在行为库 - drag and rotate. 稍加修改就是这个功能所需要的。
 | 
                        
                
                    |  lucia_5d
 职务:普通成员
 等级:1
 金币:0.0
 发贴:9
 注册:2000/11/7 10:37:51
 
 | 
                            
                            #32000/11/7 17:27:33 
                                谢谢GUO 和FLYBIRD,你们帮我大忙了:)以后有什么问题还短不了请教呢:)
 
 再次谢谢大侠了~_*
 
 lucia | 
                        
                
                    |  lucia_5d
 职务:普通成员
 等级:1
 金币:0.0
 发贴:9
 注册:2000/11/7 10:37:51
 
 | 
                            
                            #42000/11/10 9:24:21 
                                我看你写的东西了,但是我用了,不管用呀?:(不知道是什么原因:(
                                
                                
                                
                             lucia | 
                        
                
                    |  artdao
 职务:普通成员
 等级:1
 金币:0.0
 发贴:61
 注册:2000/9/15 23:56:54
 
 | 
                            
                            #52000/11/10 10:14:44 
                                用我的试一试在你另一个贴子上
 | 
                        
                
                    |  5D精英
 职务:普通成员
 等级:3
 金币:10.0
 发贴:1340
 注册:2000/10/24 12:13:42
 
 | 
                            
                            #62000/11/10 11:50:35 
                                怎么可能呢,我怎么测试都是好的,小姐你不要急我呀。各位大侠小虾快帮忙测试一下
 | 
                        
                
                    |  artdao
 职务:普通成员
 等级:1
 金币:0.0
 发贴:61
 注册:2000/9/15 23:56:54
 
 | 
                            
                            #72000/11/10 15:03:43 
                                阿guo我试了下确实不太好用
 你的maxlengthofsound=300可能设定了一个值
 对于不同大小的钮不太适合
 soundposition=position在循环外能实现吗
 
 
 
 | 
                        
                
                    |  5D精英
 职务:普通成员
 等级:3
 金币:10.0
 发贴:1340
 注册:2000/10/24 12:13:42
 
 | 
                            
                            #82000/11/10 17:39:34 
                                maxlengthofsound=300是大了一点,设成150试试,可也不至于吧。怎么个不好用法能不能说清楚点。
                                
                                
                                
                             | 
                        
                
                    |  artdao
 职务:普通成员
 等级:1
 金币:0.0
 发贴:61
 注册:2000/9/15 23:56:54
 
 | 
                            
                            #92000/11/10 18:47:30 
                                刚开始还可以按了几次之后就是不起作用
 我用debug一步一步测试,soundposition的值一直=0
 
 | 
                        
                
                    |  artdao
 职务:普通成员
 等级:1
 金币:0.0
 发贴:61
 注册:2000/9/15 23:56:54
 
 | 
                            
                            #102000/11/10 18:49:17 
                                刚开始还可以按了几次之后就是不起作用
 我用debug一步一步测试,soundposition的值一直=0
 
 | 
                        
                
                    |  5D精英
 职务:普通成员
 等级:3
 金币:10.0
 发贴:1340
 注册:2000/10/24 12:13:42
 
 | 
                            
                            #112000/11/10 20:16:59 
                                哎!无能为力,用 flyingbird 说的方法试试吧,我是鞠躬尽瘁了。
 |