也许会开发安卓版,然后跑跑Rewrite小游戏之类的是绝对没有问题的
目前具有极强的交互性,以下的视频为演示,获取触摸位置与简单的Storyboard动画。
http://v.youku.com/v_show/id_XNTcwMzI5NzY4.html
脚本代码如下(这不是原生的WP8程序,只是随便从任何位置导入(包括网络)就能执行的脚本):
采用的高级语言是IronRuby。这只是简单地调用几个系统的类库获得基本的交互能力,并没有调用我们前几天写的NS脚本的解析。总觉得这玩意儿要跟NS搭配使用才能达到最佳状态。
顺带一提:多线程支持地妥妥的,只需要include System::Threading即可……
require 'mscorlib' include System
include System::Windows::Media
include System::Windows::Media::Animation
include System::Windows::Controls
include System::Windows
include System::Threading
include System::Windows::Input
include System::IO
include System::IO::IsolatedStorage # isostore=IsolatedStorageFile.new
timer=Storyboard.new tb=TextBlock.new
tb.Text="X:0 \nY:0"
tb.name="tb"
Phone.find_name("LayoutRoot").children.add(tb)
button = Button.new
button.name="button"
button.content = "Begin"
button.width=100
Phone.find_name("LayoutRoot").children.add(button)
button.click do |s,e|
if button.Content=="Begin"
MessageBox.show("Storyboard timer begin!")
timer.Begin
button.Content="Stop"
else
MessageBox.show("Storyboard timer Stop!")
timer.Stop
button.Content="Begin"
end
end # Set the titles
# Phone.find_name("ApplicationTitle").text = "uvengine is running!"
# Phone.find_name("PageTitle").text = "IronRuby for UVEngine" # Create a new text block
textBlock = TextBlock.new
textBlock.name = "textBlock"
textBlock.text = "IronRuby is running on Windows Phone 7!"
textBlock.foreground = SolidColorBrush.new(Colors.Green)
textBlock.font_size = 48
textBlock.text_wrapping = System::Windows::TextWrapping.Wrap
# Add the text block to the page
# Phone.find_name("ContentPanel").children.add(textBlock)
# Phone.find_name("LayoutRoot").manipulationdelta do |s,e|
# delta_x=e.DeltaManipulation.Translation.X
# delta_y=e.DeltaManipulation.Translation.Y
# MessageBox.Show(Convert.ToString(delta_x)+'\n'+Convert.ToString(delta_y))
# end # timer.begin
# Touch.FrameReported.add(method(:touch))
Touch.FrameReported do |s,e|
point = e.GetPrimaryTouchPoint(nil)
x = point.Position.X
y = point.Position.Y
Phone.find_name("button").margin = Thickness.new(x-50,y-25,430-x,0)
Phone.find_name("tb").text = "X:"+Convert.ToString(x)+"\nY:"+Convert.ToString(y)
end anim = DoubleAnimation.new
anim.From = 0.0
anim.To = 1.0
anim.Duration = Duration.new(TimeSpan.FromMilliseconds(500))
Storyboard.SetTarget(anim,button)
timer.Children.Add(anim)
timer.AutoReverse = true
timer.RepeatBehavior = RepeatBehavior.Forever
Storyboard.SetTargetProperty(anim, Phone.GetPropertyPath("(UIElement.Opacity)"))
目前具有极强的交互性,以下的视频为演示,获取触摸位置与简单的Storyboard动画。
http://v.youku.com/v_show/id_XNTcwMzI5NzY4.html
脚本代码如下(这不是原生的WP8程序,只是随便从任何位置导入(包括网络)就能执行的脚本):
采用的高级语言是IronRuby。这只是简单地调用几个系统的类库获得基本的交互能力,并没有调用我们前几天写的NS脚本的解析。总觉得这玩意儿要跟NS搭配使用才能达到最佳状态。
顺带一提:多线程支持地妥妥的,只需要include System::Threading即可……
require 'mscorlib' include System
include System::Windows::Media
include System::Windows::Media::Animation
include System::Windows::Controls
include System::Windows
include System::Threading
include System::Windows::Input
include System::IO
include System::IO::IsolatedStorage # isostore=IsolatedStorageFile.new
timer=Storyboard.new tb=TextBlock.new
tb.Text="X:0 \nY:0"
tb.name="tb"
Phone.find_name("LayoutRoot").children.add(tb)
button = Button.new
button.name="button"
button.content = "Begin"
button.width=100
Phone.find_name("LayoutRoot").children.add(button)
button.click do |s,e|
if button.Content=="Begin"
MessageBox.show("Storyboard timer begin!")
timer.Begin
button.Content="Stop"
else
MessageBox.show("Storyboard timer Stop!")
timer.Stop
button.Content="Begin"
end
end # Set the titles
# Phone.find_name("ApplicationTitle").text = "uvengine is running!"
# Phone.find_name("PageTitle").text = "IronRuby for UVEngine" # Create a new text block
textBlock = TextBlock.new
textBlock.name = "textBlock"
textBlock.text = "IronRuby is running on Windows Phone 7!"
textBlock.foreground = SolidColorBrush.new(Colors.Green)
textBlock.font_size = 48
textBlock.text_wrapping = System::Windows::TextWrapping.Wrap
# Add the text block to the page
# Phone.find_name("ContentPanel").children.add(textBlock)
# Phone.find_name("LayoutRoot").manipulationdelta do |s,e|
# delta_x=e.DeltaManipulation.Translation.X
# delta_y=e.DeltaManipulation.Translation.Y
# MessageBox.Show(Convert.ToString(delta_x)+'\n'+Convert.ToString(delta_y))
# end # timer.begin
# Touch.FrameReported.add(method(:touch))
Touch.FrameReported do |s,e|
point = e.GetPrimaryTouchPoint(nil)
x = point.Position.X
y = point.Position.Y
Phone.find_name("button").margin = Thickness.new(x-50,y-25,430-x,0)
Phone.find_name("tb").text = "X:"+Convert.ToString(x)+"\nY:"+Convert.ToString(y)
end anim = DoubleAnimation.new
anim.From = 0.0
anim.To = 1.0
anim.Duration = Duration.new(TimeSpan.FromMilliseconds(500))
Storyboard.SetTarget(anim,button)
timer.Children.Add(anim)
timer.AutoReverse = true
timer.RepeatBehavior = RepeatBehavior.Forever
Storyboard.SetTargetProperty(anim, Phone.GetPropertyPath("(UIElement.Opacity)"))