summaryrefslogtreecommitdiff
path: root/Penguloon/Scenes/SupportScene.cs
diff options
context:
space:
mode:
authoraldrikboy <aldrikboy@gmail.com>2018-01-12 13:32:26 +0100
committeraldrikboy <aldrikboy@gmail.com>2018-01-12 13:32:26 +0100
commitf93e133ede2a76be1aa20a33c9fcf01308cd6df8 (patch)
tree1a906cc08cefd785628ba0e416136f843a37b7f3 /Penguloon/Scenes/SupportScene.cs
parent39b1a897eec86f532ca1417698057ae9e1130985 (diff)
dab
Diffstat (limited to 'Penguloon/Scenes/SupportScene.cs')
-rw-r--r--Penguloon/Scenes/SupportScene.cs78
1 files changed, 78 insertions, 0 deletions
diff --git a/Penguloon/Scenes/SupportScene.cs b/Penguloon/Scenes/SupportScene.cs
new file mode 100644
index 0000000..71367ca
--- /dev/null
+++ b/Penguloon/Scenes/SupportScene.cs
@@ -0,0 +1,78 @@
+using Android.Content;
+using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Audio;
+using Microsoft.Xna.Framework.Input.Touch;
+using Penguloon.Controls;
+using Penguloon.Scenes;
+using System;
+using System.Collections.Generic;
+
+namespace Penguloon.Scenes
+{
+ public class SupportScene : SceneBase
+ {
+ public SupportScene(Main main) : base(main)
+ {
+
+ }
+
+ public override void CreateControls()
+ {
+ Button btnBack = new Button(this,
+ new Vector2(50, 50),
+ StaticUIValues.MenuButtonSize, Main.Resources.GetString(Resource.String.LevelSelectionBack));
+
+ Button btnRate = new Button(this,
+ new Vector2(50, 50 + (25 * 1) + (StaticUIValues.MenuButtonSize.Y * 1)),
+ StaticUIValues.MenuButtonSize, Main.Resources.GetString(Resource.String.SupportRate));
+
+ Button btnDonate = new Button(this,
+ new Vector2(50, 50 + (25 * 2) + (StaticUIValues.MenuButtonSize.Y * 2)),
+ StaticUIValues.MenuButtonSize, Main.Resources.GetString(Resource.String.SupportDonate));
+
+ btnBack.OnClick += BtnBack_OnClick;
+ btnRate.OnClick += BtnRate_OnClick;
+
+ Controls.Add(btnBack);
+ Controls.Add(btnRate);
+ Controls.Add(btnDonate);
+ }
+
+ private void BtnRate_OnClick(object sender, ClickArgs e)
+ {
+ try
+ {
+ Intent rateIntent = new Intent(Intent.ActionView, Android.Net.Uri.Parse("market://details?id=" + Main.Context.PackageName));
+
+ Main.Activity_.StartActivity(rateIntent);
+ }
+ catch (ActivityNotFoundException ex)
+ {
+ Intent rateIntent = new Intent(Intent.ActionView, Android.Net.Uri.Parse("https://play.google.com/store/apps/details?id=" + Main.Context.PackageName));
+ Main.Activity_.StartActivity(rateIntent);
+ }
+ }
+
+ private void BtnBack_OnClick(object sender, ClickArgs e)
+ {
+ SceneManager.SelectedScene = SelectedScene.Menu;
+ }
+
+ public override void Draw(float deltaTime)
+ {
+ // background
+ Main.SpriteBatch.Draw(ContentManager.GetTexture("UI/background"),
+ destinationRectangle: new Rectangle(0, 0, (int)StaticUIValues.ScreenViewport.X, (int)StaticUIValues.ScreenViewport.Y));
+
+ DrawSnowflakes();
+
+ base.Draw(deltaTime);
+ }
+
+
+ public override void Update(float deltaTime, TouchLocation[] touchLocations)
+ {
+ base.Update(deltaTime, touchLocations);
+ }
+ }
+} \ No newline at end of file