Skip to content

Commit ef58dfd

Browse files
committed
Set up Output Zoom UI
1 parent 53b5677 commit ef58dfd

File tree

3 files changed

+43
-21
lines changed

3 files changed

+43
-21
lines changed

Bender.bmx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Global g_GraphicsOutput:GraphicsOutput = Null
2424
'////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
2525

2626
Repeat
27-
g_UserInterface = New UserInterface(g_DefaultInputZoom, g_DefaultFrameCount, g_DefaultBackgroundRed, g_DefaultBackgroundGreen, g_DefaultBackgroundBlue)
27+
g_UserInterface = New UserInterface(g_DefaultInputZoom, g_DefaultOutputZoom, g_DefaultFrameCount, g_DefaultBackgroundRed, g_DefaultBackgroundGreen, g_DefaultBackgroundBlue)
2828
g_FileIO = New FileIO()
2929
g_GraphicsOutput = New GraphicsOutput(g_UserInterface.GetMaxWorkspaceWidth())
3030
EnablePolledInput()
@@ -63,9 +63,12 @@ Repeat
6363
g_GraphicsOutput.RevertBackgroundColorAfterSave(g_FileIO.SaveFile(g_GraphicsOutput.GrabOutputForSaving()))
6464
EndIf
6565
Continue
66-
'Scale
67-
Case g_UserInterface.m_SettingsZoomTextbox
68-
g_UserInterface.SetZoomTextboxValue(g_GraphicsOutput.SetInputZoom(g_UserInterface.GetZoomTextboxValue()))
66+
'Input Scale
67+
Case g_UserInterface.m_SettingsInputZoomTextbox
68+
g_UserInterface.SetInputZoomTextboxValue(g_GraphicsOutput.SetInputZoom(g_UserInterface.GetInputZoomTextboxValue()))
69+
'Output Scale
70+
Case g_UserInterface.m_SettingsOutputZoomTextbox
71+
g_UserInterface.SetOutputZoomTextboxValue(g_UserInterface.GetOutputZoomTextboxValue())
6972
'Frames
7073
Case g_UserInterface.m_SettingsFramesTextbox
7174
g_UserInterface.SetFramesTextboxValue(g_GraphicsOutput.SetFrameCount(g_UserInterface.GetFramesTextboxValue()))

Types/SettingsManager.bmx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
'//// SETTINGS MANAGER //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
22

33
Global g_DefaultInputZoom:Int = 4
4+
Global g_DefaultOutputZoom:Int = 1
45
Global g_DefaultFrameCount:Int = 7
56
Global g_DefaultBackgroundRed:Int = 50
67
Global g_DefaultBackgroundGreen:Int = 170

Types/UserInterface.bmx

Lines changed: 35 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,10 @@ Type UserInterface
3636
Field m_SettingsPanelAnchor:SVec2I = New SVec2I(10, m_ButtonPanelSize[1] + 15)
3737
Field m_SettingsPanelSize:SVec2I = New SVec2I(m_CanvasGraphicsAnchor[0] - 20, 180)
3838

39-
Field m_SettingsZoomLabel:TGadget = Null
40-
Field m_SettingsZoomTextbox:TGadget = Null
39+
Field m_SettingsInputZoomLabel:TGadget = Null
40+
Field m_SettingsInputZoomTextbox:TGadget = Null
41+
Field m_SettingsOutputZoomLabel:TGadget = Null
42+
Field m_SettingsOutputZoomTextbox:TGadget = Null
4143

4244
Field m_SettingsFramesLabel:TGadget = Null
4345
Field m_SettingsFramesTextbox:TGadget = Null
@@ -73,14 +75,14 @@ Type UserInterface
7375

7476
'////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
7577

76-
Method New(zoomValue:Int, framesValue:Int, bgRedValue:Int, bgGreenValue:Int, bgBlueValue:Int)
77-
InitializeUserInterface(zoomValue, framesValue, bgRedValue, bgGreenValue, bgBlueValue)
78+
Method New(inputZoomValue:Int, outputZoomValue:Int, framesValue:Int, bgRedValue:Int, bgGreenValue:Int, bgBlueValue:Int)
79+
InitializeUserInterface(inputZoomValue, outputZoomValue, framesValue, bgRedValue, bgGreenValue, bgBlueValue)
7880
InitializeCanvasGraphics()
7981
EndMethod
8082

8183
'////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
8284

83-
Method InitializeUserInterface(zoomValue:Int, framesValue:Int, bgRedValue:Int, bgGreenValue:Int, bgBlueValue:Int)
85+
Method InitializeUserInterface(inputZoomValue:Int, outputZoomValue:Int, framesValue:Int, bgRedValue:Int, bgGreenValue:Int, bgBlueValue:Int)
8486
m_MainWindow = CreateWindow(AppTitle, (DesktopWidth() / 2) - ((m_CanvasGraphicsAnchor[0] + m_CanvasGraphicsSize[0]) / 2), (DesktopHeight() / 2) - (m_CanvasGraphicsSize[1] / 2), m_CanvasGraphicsAnchor[0] + m_CanvasGraphicsSize[0], m_CanvasGraphicsSize[1], Null, WINDOW_TITLEBAR | WINDOW_MENU | WINDOW_RESIZABLE | WINDOW_CLIENTCOORDS | WINDOW_ACCEPTFILES)
8587
m_HelpMenu = CreateMenu("Help", c_HelpMenuTag, WindowMenu(m_MainWindow))
8688
m_AboutMenu = CreateMenu("About", c_AboutMenuTag, WindowMenu(m_MainWindow))
@@ -116,19 +118,23 @@ Type UserInterface
116118
m_SettingsColorRTextbox = CreateTextField(GadgetX(m_SettingsColorRLabel) + 15, GadgetY(m_SettingsColorRLabel) + textboxVertOffset, textboxSize[0], textboxSize[1], m_SettingsPanel)
117119
SetGadgetText(m_SettingsColorRTextbox, bgRedValue)
118120

119-
m_SettingsColorGLabel = CreateLabel("G", 120, GadgetY(m_SettingsColorLabel), 10, labelHeight, m_SettingsPanel, LABEL_LEFT)
120-
m_SettingsColorGTextbox = CreateTextField(135, GadgetY(m_SettingsColorGLabel) + textboxVertOffset, textboxSize[0], textboxSize[1], m_SettingsPanel)
121+
m_SettingsColorGLabel = CreateLabel("G", 122, GadgetY(m_SettingsColorLabel), 10, labelHeight, m_SettingsPanel, LABEL_LEFT)
122+
m_SettingsColorGTextbox = CreateTextField(137, GadgetY(m_SettingsColorGLabel) + textboxVertOffset, textboxSize[0], textboxSize[1], m_SettingsPanel)
121123
SetGadgetText(m_SettingsColorGTextbox, bgGreenValue)
122124

123-
m_SettingsColorBLabel = CreateLabel("B", 175, GadgetY(m_SettingsColorLabel), 10, labelHeight, m_SettingsPanel, LABEL_LEFT)
124-
m_SettingsColorBTextbox = CreateTextField(190, GadgetY(m_SettingsColorBLabel) + textboxVertOffset, textboxSize[0], textboxSize[1], m_SettingsPanel)
125+
m_SettingsColorBLabel = CreateLabel("B", 180, GadgetY(m_SettingsColorLabel), 10, labelHeight, m_SettingsPanel, LABEL_LEFT)
126+
m_SettingsColorBTextbox = CreateTextField(195, GadgetY(m_SettingsColorBLabel) + textboxVertOffset, textboxSize[0], textboxSize[1], m_SettingsPanel)
125127
SetGadgetText(m_SettingsColorBTextbox, bgBlueValue)
126128

127-
m_SettingsZoomLabel = CreateLabel("Input Zoom", horizMargin, GadgetY(m_SettingsColorLabel) + labelVertOffset, 70, labelHeight + 4, m_SettingsPanel, LABEL_LEFT)
128-
m_SettingsZoomTextbox = CreateTextField(vertMargin + GadgetWidth(m_SettingsZoomLabel), GadgetY(m_SettingsZoomLabel) + textboxVertOffset, textboxSize[0], textboxSize[1], m_SettingsPanel)
129-
SetGadgetText(m_SettingsZoomTextbox, zoomValue)
129+
m_SettingsInputZoomLabel = CreateLabel("Input Zoom", horizMargin, GadgetY(m_SettingsColorLabel) + labelVertOffset, 70, labelHeight + 4, m_SettingsPanel, LABEL_LEFT)
130+
m_SettingsInputZoomTextbox = CreateTextField(vertMargin + GadgetWidth(m_SettingsInputZoomLabel), GadgetY(m_SettingsInputZoomLabel) + textboxVertOffset, textboxSize[0], textboxSize[1], m_SettingsPanel)
131+
SetGadgetText(m_SettingsInputZoomTextbox, inputZoomValue)
130132

131-
m_SettingsFramesLabel = CreateLabel("Frame Count", horizMargin, GadgetY(m_SettingsZoomLabel) + labelVertOffset, 70, labelHeight, m_SettingsPanel, LABEL_LEFT)
133+
m_SettingsOutputZoomLabel = CreateLabel("Output Zoom", 117, GadgetY(m_SettingsInputZoomLabel), 75, labelHeight + 4, m_SettingsPanel, LABEL_LEFT)
134+
m_SettingsOutputZoomTextbox = CreateTextField(horizMargin + GadgetX(m_SettingsOutputZoomLabel) + GadgetWidth(m_SettingsOutputZoomLabel) - 2, GadgetY(m_SettingsOutputZoomLabel) + textboxVertOffset, textboxSize[0], textboxSize[1], m_SettingsPanel)
135+
SetGadgetText(m_SettingsOutputZoomTextbox, outputZoomValue)
136+
137+
m_SettingsFramesLabel = CreateLabel("Frame Count", horizMargin, GadgetY(m_SettingsInputZoomLabel) + labelVertOffset, 70, labelHeight, m_SettingsPanel, LABEL_LEFT)
132138
m_SettingsFramesTextbox = CreateTextField(vertMargin + GadgetWidth(m_SettingsFramesLabel), GadgetY(m_SettingsFramesLabel) + textboxVertOffset, textboxSize[0], textboxSize[1], m_SettingsPanel)
133139
SetGadgetText(m_SettingsFramesTextbox, framesValue)
134140

@@ -208,14 +214,26 @@ Type UserInterface
208214

209215
'////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
210216

211-
Method GetZoomTextboxValue:Int()
212-
Return GadgetText(m_SettingsZoomTextbox).ToInt()
217+
Method GetInputZoomTextboxValue:Int()
218+
Return GadgetText(m_SettingsInputZoomTextbox).ToInt()
219+
EndMethod
220+
221+
'////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
222+
223+
Method SetInputZoomTextboxValue(newValue:Int)
224+
SetGadgetText(m_SettingsInputZoomTextbox, newValue)
225+
EndMethod
226+
227+
'////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
228+
229+
Method GetOutputZoomTextboxValue:Int()
230+
Return GadgetText(m_SettingsOutputZoomTextbox).ToInt()
213231
EndMethod
214232

215233
'////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
216234

217-
Method SetZoomTextboxValue(newValue:Int)
218-
SetGadgetText(m_SettingsZoomTextbox, newValue)
235+
Method SetOutputZoomTextboxValue(newValue:Int)
236+
SetGadgetText(m_SettingsOutputZoomTextbox, newValue)
219237
EndMethod
220238

221239
'////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

0 commit comments

Comments
 (0)