I know what you mean, and the thought crossed my mind.
But it's still slightly dangerous in respect of ever wanting to update the small amount of ui the stack comes with as new.
Imagine if you will, when ios7 comes out, old apps are going to look very dated.
That could happen in the near future to OSX.
Or imagine if i overlook some geometry bug or the like in the main stack and only get it reported after release.. eek..!
And if i go down this road i am locking myself in for the long haul.
I'd kick myself if the app became a real success and sold in the hundreds of thousands.
Thats after pinching myself if one of my apps ever sells in the hundreds of thousands
Though it does appear to be quite complex for me to save out every time the user creates a new ui element
I think i should try and figure out a fluid way to do it.
And of course a quick way to write it back in at every launch.
heres an example of just one of the ui elements a allow a user to create, and would need to be written out somewhere and there could potentially be hundreds of these elements in time.
Code: Select all
on createNewBucket
lock screen
// new round rect background template
put the number of groups of group "buckets" + 1 into tNewGroupId
create group ("bucket" & tNewGroupId) in group "buckets"
set the behavior of group ("bucket" & tNewGroupId) to the long id of button "deleteBucket" of stack "behaviours"
set the layerMode of group ("bucket" & tNewGroupId) to "dynamic"
create graphic "Background" in group ("bucket" & tNewGroupId)
set the layerMode of graphic "Background" of group ("bucket" & tNewGroupId) to "dynamic"
set the style of graphic "Background" of group ("bucket" & tNewGroupId) to roundrect
set the roundRadius of graphic "Background" of group ("bucket" & tNewGroupId) to 20
set the opaque of graphic "Background" of group ("bucket" & tNewGroupId) to true
set the width of graphic "Background" of group ("bucket" & tNewGroupId) to 200
set the height of graphic "Background" of group ("bucket" & tNewGroupId) to 200
put "254,105,22" into tDarkOrange
put changeRgbShade(tDarkOrange, 1.8) into tLightOrange
set the fillGradient["ramp"] of graphic "Background" of group ("bucket" & tNewGroupId) of me to 0,tLightOrange,255 & return & 1,tDarkOrange,255
set the fillGradient["type"] of graphic "Background" of group ("bucket" & tNewGroupId) to "linear"
set the fillGradient["from"] of graphic "Background" of group ("bucket" & tNewGroupId) to the left of graphic "Background" of group ("bucket" & tNewGroupId) , the bottom of graphic "Background" of group ("bucket" & tNewGroupId)
set the fillGradient["to"] of graphic "Background" of group ("bucket" & tNewGroupId) to the left of graphic "Background" of group ("bucket" & tNewGroupId) , the top of graphic "Background" of group ("bucket" & tNewGroupId)
set the fillGradient["via"] of graphic "Background" of group ("bucket" & tNewGroupId) to item 1 of the loc of graphic "Background" of group ("bucket" & tNewGroupId) , the bottom of graphic "Background" of group ("bucket" & tNewGroupId)
set the foregroundcolor of graphic "Background" of group ("bucket" & tNewGroupId) to "#999999"
// create image cutter graphic
create graphic "Cutter" in group ("bucket" & tNewGroupId)
set the layerMode of graphic "Cutter" of group ("bucket" & tNewGroupId) to "dynamic"
set the style of graphic "Cutter" of group ("bucket" & tNewGroupId) to rectangle
set the opaque of graphic "Cutter" of group ("bucket" & tNewGroupId) to true
set the width of graphic "Cutter" of group ("bucket" & tNewGroupId) to 180
set the height of graphic "Cutter" of group ("bucket" & tNewGroupId) to 180
set the backgroundColor of graphic "Cutter" of group ("bucket" & tNewGroupId) to "#ffffff"
set the linesize of graphic "Cutter" of group ("bucket" & tNewGroupId) to 0
set the loc of graphic "Cutter" of group ("bucket" & tNewGroupId) to the loc of graphic "Background" of group ("bucket" & tNewGroupId)
// temp image
create image "placeholder" in group ("bucket" & tNewGroupId)
set the layerMode of image "placeholder" of group ("bucket" & tNewGroupId) to "dynamic"
set the width of image "placeholder" of group ("bucket" & tNewGroupId) to 180
set the height of image "placeholder" of group ("bucket" & tNewGroupId) to 180
set the borderWidth of image "placeholder" of group ("bucket" & tNewGroupId) to 0
set the imageData of image "placeholder" of group ("bucket" & tNewGroupId) to the imageData of image "temp" of stack "imageLib"
set the loc of image "placeholder" of group ("bucket" & tNewGroupId) to the loc of graphic "Background" of group ("bucket" & tNewGroupId)
// create bucket label
create field "Label" in group ("bucket" & tNewGroupId)
set the layerMode of field "Label" of group ("bucket" & tNewGroupId) to "dynamic"
set the loc of field "Label" of group ("bucket" & tNewGroupId) to item 1 of the loc of graphic "Background" of group ("bucket" & tNewGroupId),item 2 of the loc of graphic "Background" of group ("bucket" & tNewGroupId) + 120
put "Bucket" && tNewGroupId into field "Label" of group ("bucket" & tNewGroupId)
set the textStyle of field "Label" of group ("bucket" & tNewGroupId) to "bold"
set the textAlign of field "Label" of group ("bucket" & tNewGroupId) to "center"
set the textSize of field "Label" of group ("bucket" & tNewGroupId) to 12
set the opaque of field "Label" of group ("bucket" & tNewGroupId) to false
set the showBorder of field "Label" of group ("bucket" & tNewGroupId) to false
set the traversalOn of field "Label" of group ("bucket" & tNewGroupId) to false
if the number of groups of group "buckets" > 1 then
repositionBuckets
positionFirstBucket tNewGroupId
else
positionFirstBucket tNewGroupId
end if
unlock screen
end createNewBucket
Thanks for your thoughts though Klaus.