Skip to content

Instantly share code, notes, and snippets.

View chaosddp's full-sized avatar

Chaos Yu chaosddp

  • Beijing
  • 15:27 (UTC +08:00)
View GitHub Profile
// TinyTween.cs
//
// Copyright (c) 2013 Nick Gravelyn
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software
// and associated documentation files (the "Software"), to deal in the Software without restriction,
// including without limitation the rights to use, copy, modify, merge, publish, distribute,
// sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
@chaosddp
chaosddp / ClickImage_MyScene.cs
Last active August 29, 2015 14:07
Handle click/tap event of Image using WaveEngine, image resource is from examples of PhaserJS
#region Using Statements
using System;
using WaveEngine.Common;
using WaveEngine.Common.Graphics;
using WaveEngine.Common.Math;
using WaveEngine.Components.Cameras;
using WaveEngine.Components.Gestures;
using WaveEngine.Components.Graphics2D;
using WaveEngine.Components.Graphics3D;
using WaveEngine.Framework;
@chaosddp
chaosddp / LoadImage_MyScene.cs
Created October 11, 2014 05:50
Load Image using WaveEngine, image resource is from examples of PhaserJS
#region Using Statements
using System;
using WaveEngine.Common;
using WaveEngine.Common.Graphics;
using WaveEngine.Common.Math;
using WaveEngine.Components.Cameras;
using WaveEngine.Components.Graphics2D;
using WaveEngine.Components.Graphics3D;
using WaveEngine.Framework;
using WaveEngine.Framework.Graphics;
@chaosddp
chaosddp / MoveToPointerBehavior.cs
Last active August 29, 2015 14:08
Make the entity move to current mouse pointer
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WaveEngine.Common.Math;
using WaveEngine.Framework;
using WaveEngine.Framework.Graphics;
using WaveEngine.Framework.Services;
@chaosddp
chaosddp / Animation_MyScene.cs
Last active August 29, 2015 14:08
Display spritesheet animation
#region Using Statements
using Share;
using System;
using WaveEngine.Common;
using WaveEngine.Common.Graphics;
using WaveEngine.Common.Math;
using WaveEngine.Components.Animation;
using WaveEngine.Components.Cameras;
using WaveEngine.Components.Graphics2D;
using WaveEngine.Components.Graphics3D;
ChatMessage msg = new ChatMessage();
msg.Body = "content here";
msg.Recipients.Add("number here");
await ChatMessageManager.ShowComposeSmsMessageAsync(msg);
await Windows.System.Launcher.LaunchUriAsync(new Uri("tel:" + "number here"));
// or
Windows.ApplicationModel.Calls.PhoneCallManager.ShowPhoneCallUI("number here", "test");
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
// maybe not exist this
if (ApiInformation.IsTypePresent("Windows.Phone.Devices.Notification.VibrationDevice"))
{
var vibrateDevice = Windows.Phone.Devices.Notification.VibrationDevice.GetDefault();
var duration = TimeSpan.FromMilliseconds(1000);
vibrateDevice.Vibrate(duration);
}
ContactPicker pickcer = new ContactPicker();
pickcer.DesiredFieldsWithContactFieldType.Add(ContactFieldType.PhoneNumber);
pickcer.SelectionMode = ContactSelectionMode.Fields;
var contact = await pickcer.PickContactAsync();