Dev:SDK/Core - Functions - Images

From Slavemaker Wiki
Jump to: navigation, search
<<first <prev SDK/Core - Functions - Images next> last>>


Core Image Functions

These are the functions for displaying or manipluating images. Standard Flash functions can of course still be used.

These functions are all in _root scope

If a parameter is noted to have a default, then the parameter can be omitted

eg

ShowSlaveMaker(true);
ShowSlaveMaker();

Note if you omit a parameter you must also omit all following parameters. If you wish to only default a parameter and not the following ones then pass the value undefined. Or just pass a resonable value for the parameters

eg

_root.StartShakeIt(SpankClip);
_root.StartShakeIt(SpankClip, 1000);
_root.StartShakeIt(SpankClip, undefined, "Ouch");

Display areas

  1. Main Window - the large window, upper left. It is 4x3 aspect ratio and

is 448x336 pixels now

  1. People Window - the smaller window on the lower left. It is square 1x1

aspect ratio, 153x153 pixels, and is used to show people, your assistant etc

Core Image Functions[edit]

ShowMovie
Show a movie in the main window or small people/item window. The image will be made visible and resized as needed
function ShowMovie(movie:MovieClip, position:Number, align:Number, gframe:Number)
movie = the MovieClip to be positioned
position = the areas of the screen to position the image in
0 = People Window. Any assistant or slave maker image will be hidden first
1 = Main Window
2 = entire stage
3 = assistant selection
4 = girls introduction area used when the girls training starts
5 = item selection window
6 = slave picker
7 = assistant selection, fixed size
8 = slave maker profile
10 same as 0
Note this is changed: originally this was a Boolean where true = Main Window, false was People Window. In Flash false == 0 and true == 1 in this case so it is backwardly compatible
Please discontinue the use of true/false
align
0 = fill entire area
1 = center horizontally, fill the area so the image fills the available height
2 = fill height and position at the left of the widow
3 = right align
4 = bottom right
5 = top left (at full size), designed to hide part of the image/person (see Astrid)
6 = center (large size)
7 = fill entire width of window and align to top of the window
8 = fill entire width of the window, center vertically
9 = center vertically (use 1 or 8 depending on aspect ratio of the target movie)
10 = same as 0 (mainly for using -10)
11 = fill image to the entire stage (800x600 at 0,0)
12 = (internal use) position in the assistant selection area
13 = fill width and position at the bottom of the window
14 = center horizontally (use 1 or 3 depending or aspect ratio)
> 100 = flip horizontal and treat as align - 100
< 0 = do not make visible, and treat as a positive value of align
gframe = frame of movie to gotoAndStop to, optional will not change the movie clip frame if not specified
If gframe is negative (ie -1) it will start playback of the MovieClip from the specified frame, ie gotoAndPlay(gframe * -1);
NOTES:
  1. any frames in a movie clip you wish to use this function with must be postioned at x=0, y=0 interally in the MovieClip. ie when you edit the movieclip and add the frame make sure the frame is at position x=0, y=0,it does not matter where the movieclip itself is positioned
  2. Any colour transform on the image is reset when this function is called
eg
ShowMovie(_root.ClipTrial, 1, 0);
ShowMovie(ClipSpank, 1, 1, Math.floor(Math.random()*2) + 1);
HideImages
function HideImages()
hide general/common images
HideSlaveActions
function HideSlaveActions()
hide slave actions (ie fuck, cleaning etc) + generic versions
HideBackgrounds
function HideBackgrounds()
hide all places like docks, forest etc
HideStatChangeIcons
function HideStatChangeIcons()
Hide the statistics icons/text for both you and your slave
ShowSlaveMaker
will show the slave makers image
function ShowSlaveMaker(profile:Boolean)
profile - optional will show the image in the people window. Otherwise can show for Seer/Intro screens if true.
Default false
Will hide any people or assistants if profile = false
eg
ShowSlaveMaker();       // show in people window
Note: remember ShowAssistant
ShowSupervisor
will show the person (assistant or slavemaker) who is supervising
function ShowSupervisor() : Boolean
return - true if your slave maker is supervising
eg
if (_root.ShowSupervisor()) {
        // slave maker image shown
        _root.AddText("You take your slave....");
} else {
        // assistant image shown
        _root.AddText(_root.ServantName + " takes your slave...");
}
HideSupervisor
will hide the person (assistant or slavemaker) who is supervising
function HideSupervisor()
ShowMainButtons
Show the Morning/Planning/Slave Market buttons
function ShowMainButtons(hideb:Boolean)
hideb - true - hide buttons, false = show buttons, defaults to false
Generally avoid using this
ShowOverlay
show a solid background colour in the main window
function ShowOverlay(colour:Number)
colour - hex value like 0xff1010 (rgb format)
eg
_root.ShowOverlay(0);           // solid black
_root.ShowOverlay(0xFF0000);    // solid red
_root.ShowOverlay(0xFFFFFF);    // solid white, but it is the default so not
particularly needed
SetMovieColour
colours temporarily a movie adding to its red, green, blue, alpha channels
function SetMovieColour(target_mc:MovieClip, red:Number, green:Number, blue:Number, alphao:Number, redmul:Number, greenmul:Number, bluemul:Number, alphamul:Number)
red, green, blue, alphao - 0-255 for red channel, blue and alpha (tranparency), alphao defaults to 0 (solid)
redmul, greenmul, bluemul, alphamul - 0-1 a mutiplier applied to the channel (defaults to 1)
Note ShowMovie resets the colour transform when it is next called on this image
eg
_root.SetMovieColour(_root.PlaceTentacles, 0, 0, 110);
Note
standard backgrounds are darkened at night with _root.SetLastMovieColour(-200, -70, 0);
SetLastMovieColour
colours temporarily the last movie shown using ShowMovie adding to its red, green, blue channels
function SetMovieColour(red:Number, green:Number, blue:Number, alphao:Number, redmul:Number, greenmul:Number, bluemul:Number, alphamul:Number)
red, green, blue, alphao - 0-255 for red channel, blue and alpha (tranparency), alphao defaults to 0 (solid)
redmul, greenmul, bluemul, alphamul - 0-1 a mutiplier applied to the channel (defaults to 1)
Note ShowMovie resets the colour transform when it is next called on this image
Note
standard backgrounds are darkened at night with _root.SetLastMovieColour(-200, -70, 0);
ShowDividerPercentage
function ShowDividerPercentage(xperc:Number)
Show a vertical divider down the main window
xperc - percent of the way across the window, remember Number is floating point
ShowDividerX
function ShowDividerX(xpos:Number)
As above but pixels used. Left of main window = 7

Simple Animations[edit]

Note all times are in milliseconds and ideally should be multiples of 1/24 of a second

StartFadeImage
fade a movie clip to invisible (varies alpha channel)
function StartFadeImage(duration:Number, mc:MovieClip, say:String)
duration - time in milliseconds between changes to alpha channel
mc - movieclip to fade
say - once full hidden say will be shown (ie AddText(say))
StartFuckIt
Show the image with a simple fucking like motion
function StartFuckIt(mc:MovieClip, lockx:Boolean, left:Boolean)
mc - movieclip to fuck
lockx - x position will stay fixed if true
left - at left of main window, else right
StartShakeIt
Shake the image from side to side a couple of times
function StartShakeIt(mc:MovieClip, inittime:Number, comment:String)
mc - movieclip to shake
inittime - time before shaking starts, defualt 0
comment - when shaking done will display this text using AddText if not "" or undefined
StartChangeImage
After a time change a movie clip to a new frame, optionally hiding and showing other clips
function StartChangeImage(duration:Number, mc:MovieClip, newpos:Number, say:String, hide_mc:MovieClip, show_mc:MovieClip)
duration - time to change happening
mc - clp to change
newpos - will do mc.gotoAndStop(newpos);
say - after change AddText(say) (if present and not "")
hide_mc - after change this clip will be hidden (hide_mc._visible = false) - optional
show_mc - after change this clip will be shown (hide_mc._visible = true) - optional
StartZoomImage
Zoom in on a part of an image (as used in the take a walk action)
function StartZoomImage(mc:MovieClip, duration:Number, steps:Number, endscale:Number, xpos:Number, ypos:Number, hideimage:Boolean) {
mc - movieclip to zomm in on
duration - time between changes of the zoom
steps - how many moves/changes in the zoom process
endscale - ending magnification (eg 300 for 3x)
xpos - x position to zoom in on the base image
ypos - y poaition to zoon in on
hideimage - true and the image will be hidden when the zoom in finished
eg
StartZoomImage(WalkZoom, 42, 12, 400, 440, 40);
StartMoveImage
Move an image from one point to another
function StartMoveImage(mc:MovieClip, duration:Number, steps:Number, startxpos:Number, startypos:Number, endxpos:Number, endypos:Number, hidemc:MovieClip)
mc - the movieclip to move
duration - time between moves
steps - number of moves
startxpos - the starting x position of the movie clip
startypos - the starting y position of the movie clip
endxpos - the ending x position of the movie clip
endypos - the ending y position of the movie clip
hideimage - true and the image will be hidden when the zoom in finished
StartAlternateImage
Alternate two frames of am image
function StartAlternateImage(duration:Number, mc:MovieClip, newpos:Number, oldpos:Number)
mc - the movieclip to move
duration - time between moves
newpos - the second frame to gotoAndStop(newpos) to
oldpos - the first frame to gotoAndStop(oldpos)
StartCumSplatter
Shows a white flash and then a splatter of cum over the main window
function StartCumSplatter(delay:Number, mc:MovieClip, align:Number, frame:Number, moveonly:Boolean)
delay - wait before white flash
mc - the movieclip show after the white flash
align - as in ShowMovie, applied to mc
frame - frame of mc to show
moveonly - legacy, will just use gotoAndStop not ShowMovie

Dynamic Images[edit]

AttachMovie
function AttachMovie(movie:String) : MovieClip
Creates a movieclip and loads a movie from an exported movieclip in your project.
When you no longer need the image either use removeMovieClip or RemoveAttachedMovie below
Parameters
movie - name of the exported movie
eg
var mc:MovieClip = AttachMovie("Event Milking");
AttachAndShowMovie
function AttachAndShowMovie(movie:String, main:Number, align:Number, gframe:Number) : MovieClip
Creates a movieclip and loads a movie from an exported movieclip in your project.
When you no longer need the image either use removeMovieClip or RemoveAttachedMovie below
Parameters
movie - name of the exported movie
all others the same as for ShowMovie
eg
var mc:MovieClip = AttachAndShowMovie("Event Milking", 1, 0);
RemoveAttachedMovie
function RemoveAttachedMovie(movie:MovieClip)
Removes a movieclip created by AttachAndShowMovie
simply does movie.removeMovieClip();
AutoAttachAndShowMovie
function AutoAttachAndShowMovie(movie:String, main:Number, align:Number, gframe:Number) : MovieClip
As AttachAndShowMovie but the engine will automatically remove the movieclip next time HideImages() is called. Useful for images shown on a one-off basis, say an event etc.
AttachBitmap
function AttachBitmap(movie:String) : MovieClip
Creates a movieclip and loads a bitmap from the library into it.
When you no longer need the image either use removeMovieClip or RemoveAttachedMovie below
Parameters
movie - name of the exported movie
eg
var mc:MovieClip = AttachBitmap("Event Milking");
AttachAndShowBitmap
function AttachAndShowBitmap(movie:String, main:Number, align:Number,

gframe:Number) : MovieClip

Creates a movieclip and loads a bitap from an exported bitmap in your

project.

When you no longer need the image either use removeMovieClip or RemoveAttachedMovie below
Parameters
movie - name of the exported movie
all others the same as for ShowMovie
eg
var mc:MovieClip = AttachAndShowBitmap("Event Milking", 1, 0);
AutoAttachAndShowBitmap
function AutoAttachAndShowBitmap(movie:String, main:Number, align:Number, gframe:Number) : MovieClip
As AttachAndShowBitmap but the engine will automatically remove the movieclip next time HideImages() is called. Useful for images shown on a one-off basis, say an event etc.
LoadImageAndShowMovie
function LoadImageAndShowMovie(movie:String, main:Number, align:Number, gframe:Number) : MovieClip
Creates a movieclip and loads a movie from a filename, say a jpg, png or gif file.
When you no longer need the image either use unloadMovie or RemoveLoadedImage below
Parameters
movie - name of the exported movie
all others the same as for ShowMovie
Note filenames are relative to the swf file. Do not use absolute paths, it will fail at runtime for other people
Also the image takes a small amount of time to load, maybe 0.5 seconds, so do not use the MovieClip object immediately after calling as any changes will be lost when the image actually loads
eg
var mc:MovieClip = LoadImageAndShowMovie("Milking.jpg", 1, 0);
RemoveLoadedImage
function RemoveLoadedImage(movie:MovieClip)
Removes a movieclip created by LoadImageAndShowMovie
simply does movie.unloadMovie();
eg
_root.RemoveLoadedImage(mc);
AutoLoadImageAndShowMovie
function AutoLoadImageAndShowMovie(movie:String, main:Number, align:Number, gframe:Number) : MovieClip
As LoadImageAndShowMovie but the engine will automatically remove and unload the movieclip next time HideImages() is called. Useful for images shown on a one-off basis, say an event etc. Can be used for planning actions but be aware of the small delay in loading
eg
AutoLoadImageAndShowMovie("Milking.jpg", 1, 0);
LoadImage
function LoadImage(image:MovieClip, movie:String, target:MovieClip) : MovieClip
Loads an image into a movieclip, it is not shown. Otherwise the same as LoadImageAndShowMovie


<<first <prev SDK/Core - Functions - Images next> last>>