Skip to content

Commit

Permalink
resolution fix
Browse files Browse the repository at this point in the history
  • Loading branch information
nczakaria committed Aug 13, 2015
1 parent 51ab048 commit d9a3f23
Show file tree
Hide file tree
Showing 12 changed files with 69 additions and 60 deletions.
Binary file modified KSKInterface/src/assets/Button_Texture_Pause.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified KSKInterface/src/assets/Button_Texture_Play.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
62 changes: 32 additions & 30 deletions KSKInterface/src/sg/edu/smu/ksketch2/KSketchGlobals.as
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ package sg.edu.smu.ksketch2
public static var FONT_SIZE_300:Number = 300;

//Main rectangle
public static var RECT_STRENGTH:Number = 1;
public static var RECT_BLURX:Number = 12;
public static var RECT_BLURY:Number = 12;
public static const RECT_STRENGTH:Number = 1;
public static const RECT_BLURX:Number = 12;
public static const RECT_BLURY:Number = 12;
public static var RECT_RADIUSX:Number = 5;
public static var RECT_RADIUSY:Number = 5;

Expand All @@ -62,36 +62,38 @@ package sg.edu.smu.ksketch2

public static function setView():void
{
if(Capabilities.screenResolutionX > Capabilities.screenResolutionY)
{
WIDTH = Capabilities.screenResolutionX;
HEIGHT = Capabilities.screenResolutionY;
}
else

if(Capabilities.playerType != "PlugIn")
{
WIDTH = Capabilities.screenResolutionY;
HEIGHT = Capabilities.screenResolutionX;
if(Capabilities.screenResolutionX > Capabilities.screenResolutionY)
{
WIDTH = Capabilities.screenResolutionX;
HEIGHT = Capabilities.screenResolutionY;
}
else
{
WIDTH = Capabilities.screenResolutionY;
HEIGHT = Capabilities.screenResolutionX;
}

ASPECTRATIO = int((WIDTH/HEIGHT)*100)/100;

if(WIDTH > 1280 && HEIGHT > 960)
SCALE = 2;

FONT_SIZE_10 = 10 * SCALE;
FONT_SIZE_10_5 = 10.5 * SCALE;
FONT_SIZE_14 = 14 * SCALE;
FONT_SIZE_18 = 18 * SCALE;
FONT_SIZE_20 = 20 * SCALE;
FONT_SIZE_26 = 26 * SCALE;
FONT_SIZE_60 = 60 * SCALE;
FONT_SIZE_300 = 300 * SCALE;

RECT_RADIUSX = 5 * SCALE;
RECT_RADIUSY = 5 * SCALE;
}

ASPECTRATIO = int((WIDTH/HEIGHT)*100)/100;

if(WIDTH > 1280 && HEIGHT > 960)
SCALE = 2;

FONT_SIZE_10 = 10 * SCALE;
FONT_SIZE_10_5 = 10.5 * SCALE;
FONT_SIZE_14 = 14 * SCALE;
FONT_SIZE_18 = 18 * SCALE;
FONT_SIZE_20 = 20 * SCALE;
FONT_SIZE_26 = 26 * SCALE;
FONT_SIZE_60 = 60 * SCALE;
FONT_SIZE_300 = 300 * SCALE;

RECT_STRENGTH = 1 * SCALE;
RECT_BLURX = 12 * SCALE;
RECT_BLURY = 12 * SCALE;
RECT_RADIUSX = 5 * SCALE;
RECT_RADIUSY = 5 * SCALE;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@
[Bindable]
public var upColor:uint = KSketchGlobals.COLOR_GREY_LIGHT;
private var BUTTONWIDTH:Number = 50 * KSketchGlobals.SCALE;
private var BUTTONHEIGHT:Number = 50 * KSketchGlobals.SCALE;
private var BUTTONDIMENSION:Number = 55 * KSketchGlobals.SCALE;
]]>
</fx:Script>
Expand All @@ -64,7 +63,7 @@

<s:filters>
<s:DropShadowFilter
alpha="0.6"
alpha="0.4"
alpha.disabled="0"
angle="0.5"
color="{KSketchGlobals.COLOR_BLACK}"
Expand Down Expand Up @@ -93,7 +92,7 @@
</s:stroke>
</s:Rect>

<s:Group id="buttonGroup" width="{BUTTONWIDTH}" height="{BUTTONHEIGHT}" alpha.disabled="0.25">
<s:Group id="buttonGroup" width="{BUTTONDIMENSION}" height="{BUTTONDIMENSION}" alpha.disabled="0.25">
<s:layout>
<s:HorizontalLayout verticalAlign="middle" horizontalAlign="center"/>
</s:layout>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
<fx:Script>
<![CDATA[
import spark.components.Label;
import spark.layouts.VerticalLayout;
protected var _label:String;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<![CDATA[
import sg.edu.smu.ksketch2.KSketchGlobals;
private var BUTTONHEIGHT = 50 * KSketchGlobals.SCALE;
private var BUTTONHEIGHT:Number = 50 * KSketchGlobals.SCALE;
]]>
</fx:Script>

Expand All @@ -56,15 +56,17 @@
<s:State name="down" />
<s:State name="disabled" />
</s:states>
<!-- layer 2: fill -->
<!--- @private -->
<s:Rect id="fill" left="1" right="1" top="1" bottom="1" radiusX="5">
<s:stroke>
<s:SolidColorStroke color="{KSketchGlobals.COLOR_BLACK}"/>
</s:stroke>
<s:fill>
<s:SolidColor color="{KSketchGlobals.COLOR_GREY_VERYLIGHT}"/>
<s:SolidColor color.up="{KSketchGlobals.COLOR_GREY_VERYLIGHT}"
color.over="{KSketchGlobals.COLOR_GREY_DARK}"
color.down="{KSketchGlobals.COLOR_GREY_DARK}"/>
</s:fill>
</s:Rect>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*http://mozilla.org/MPL/2.0/.
-->
<s:Button xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark" width="{height}" height="100%" initialize="initSkin()"
xmlns:s="library://ns.adobe.com/flex/spark" initialize="initSkin()"
skinClass="sg.edu.smu.ksketch2.canvas.components.buttons.KSketch_List_Button_Skin">
<fx:Script>
<![CDATA[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ in accordance with the terms of the license agreement accompanying it.
<fx:Metadata>
[HostComponent("spark.components.Button")]
</fx:Metadata>

<s:states>
<s:State name="up"/>
<s:State name="over"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@
private function set buttonState(value:int):void
{
var textureControl:Image = (skin as KSketch_Canvas_Button_Skin).texture;
_buttonState = value;
if(_buttonState == SHOW_PLAY)
Expand All @@ -145,6 +144,8 @@
textureControl.source = KSketchAssets.texture_pause;
(skin as KSketch_Canvas_Button_Skin).upColor = KSketchGlobals.COLOR_RED;
(skin as KSketch_Canvas_Button_Skin).width = 60 * KSketchGlobals.SCALE;
(skin as KSketch_Canvas_Button_Skin).height = 60 * KSketchGlobals.SCALE;
}
]]>
</fx:Script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,11 @@
helpButton.init(KSketchAssets.texture_help, KSketchAssets.texture_help_down, false);
helpButton.initSkin();
if((Capabilities.version.indexOf('IOS') > -1) || (Capabilities.os.toLowerCase().indexOf("mac") == -1))
/*if((Capabilities.version.indexOf('IOS') > -1) || (Capabilities.os.toLowerCase().indexOf("mac") == -1))
shareButton.init(KSketchAssets.texture_share_ios, KSketchAssets.texture_share_ios_down, false);
else
shareButton.init(KSketchAssets.texture_share_android, KSketchAssets.texture_share_android_down, false);
shareButton.initSkin();
shareButton.initSkin();*/
if(_saveOptions)
{
Expand Down Expand Up @@ -550,9 +550,11 @@
id="helpButton"
/>

<!--
<buttons:KSketch_CanvasButton
click="_openSharingOptions()"
id="shareButton"
/>
-->
</s:Group>
</s:SkinnablePopUpContainer>
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import sg.edu.smu.ksketch2.KSketch2;
import sg.edu.smu.ksketch2.KSketchAssets;
import sg.edu.smu.ksketch2.KSketchGlobals;
import sg.edu.smu.ksketch2.canvas.components.buttons.KSketch_Canvas_Button_Skin;
import sg.edu.smu.ksketch2.canvas.components.view.KSketch_CanvasView;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@
import mx.graphics.codec.JPEGEncoder;
import mx.managers.PopUpManager;
import mx.utils.Base64Encoder;
import sg.edu.smu.ksketch2.KSketch_Config;
import spark.events.ViewNavigatorEvent;
import spark.managers.PersistenceManager;
Expand All @@ -47,6 +45,7 @@
import sg.edu.smu.ksketch2.KSketch2;
import sg.edu.smu.ksketch2.KSketchAssets;
import sg.edu.smu.ksketch2.KSketchGlobals;
import sg.edu.smu.ksketch2.KSketch_Config;
import sg.edu.smu.ksketch2.canvas.KSketch_CanvasView_Preferences;
import sg.edu.smu.ksketch2.canvas.components.popup.KSketch_Alert;
import sg.edu.smu.ksketch2.canvas.components.popup.KSketch_DialogBox_Skin;
Expand Down Expand Up @@ -74,6 +73,7 @@
import sg.edu.smu.ksketch2.model.objects.KGroup;
import sg.edu.smu.ksketch2.model.objects.KInstructions;
import sg.edu.smu.ksketch2.model.objects.KObject;
import sg.edu.smu.ksketch2.model.objects.KStroke;
import sg.edu.smu.ksketch2.operators.operations.KCompositeOperation;
import sg.edu.smu.ksketch2.utils.KIOEvent;
Expand All @@ -82,6 +82,7 @@
private var DRAWINGSTAGE_BORDER:Number = 1 * KSketchGlobals.SCALE;
private var TIMEBAR_GAP:Number = 4 * KSketchGlobals.SCALE;
private var TIMEBAR_PADDING:Number = 5 * KSketchGlobals.SCALE;
private var TIMEBAR_PLAYDIMENSION:Number = 60 * KSketchGlobals.SCALE;
private var SYNPHNE_PADDINGTOP:Number = 10 * KSketchGlobals.SCALE;
private var SYNPHNE_PADDINGRIGHT:Number = 5 * KSketchGlobals.SCALE;
private var SYNPHNE_TIMERLABEL_WIDTH:Number = 100 * KSketchGlobals.SCALE;
Expand Down Expand Up @@ -249,13 +250,17 @@
//Initiate the controls
if(!isPlayer)
{
_transitionHelper = new KWidgetInteractorManager(_KSketch, _interactionControl, widget, modelDisplay);
//KSKETCH-SYNPHNE
if(!isSynphne)
{
_transitionHelper = new KWidgetInteractorManager(_KSketch, _interactionControl, null, widget, modelDisplay);
_selectionHelper = new KCanvasInteractorManager(_KSketch, _interactionControl, null, canvas_region, modelDisplay, motionDisplay, _feedbackPopUp);
}
else
{
_transitionHelper = new KWidgetInteractorManager(_KSketch, _interactionControl, _activityControl, widget, modelDisplay);
_selectionHelper = new KCanvasInteractorManager(_KSketch, _interactionControl, _activityControl, canvas_region, modelDisplay, motionDisplay, _feedbackPopUp);
}
}
if(!isWeb)
Expand Down Expand Up @@ -684,21 +689,18 @@
public function resetTimeControl():void
{
_KSketch.time = 0;
//_magnifier.setToTime(_KSketch.time);
_magnifier.setToTime(_KSketch.time);
}
public function autoPlayAnimation():void
public function get timeTaken():int
{
playButton.playToggle(true);
_activityControl.autoSelectObjectToAnimate();
return _timeTaken; //in milliseconds
}
public function get activityType():String
public function autoPlayAnimation():void
{
var activityType:String = "SKETCH";
if(_activityControl)
activityType = _activityControl.activityType;
return activityType;
playButton.playToggle(true);
_activityControl.autoSelectObjectToAnimate();
}
public function setAnimationPlaying(value:Boolean):void
Expand Down Expand Up @@ -737,17 +739,21 @@
return regionsArr;
}
public function get starValueArr():Array
{
return _options.starValueArr;
}
public function getCurrentTemplateObjectView():IObjectView
{
var currentId:int = _instructionsBox.currentObjectID();
for(var i:int=0; i<_KSketch.root.children.length(); i++)
{
var currObj:KObject = _KSketch.root.children.getObjectAt(i) as KObject;
/*if(currObj is KStroke && currObj.id == currentId)
if(currObj is KStroke && currObj.id == currentId)
{
return modelDisplay.viewsTable[currObj];
}*/
}
}
return null;
}
Expand Down

0 comments on commit d9a3f23

Please sign in to comment.