0% found this document useful (0 votes)
39 views

Text Notescript

This document describes the creation of an object in Easy CBT software. It defines parameters like the name, type, color, size and other properties. It then creates a new member object, assigns the parameters, and adds a sprite to display the object on stage. If it is a text object, it also sets the text content and properties.

Uploaded by

oscar
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views

Text Notescript

This document describes the creation of an object in Easy CBT software. It defines parameters like the name, type, color, size and other properties. It then creates a new member object, assigns the parameters, and adds a sprite to display the object on stage. If it is a text object, it also sets the text content and properties.

Uploaded by

oscar
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 4

--////////////////////////////////////////////////////////---->2002

CREATION Obj 2002<--


--////////////////////////////////////////////////////////--on new me return me
end -->OBJ COUNTon IsSimpleLibObj me --(1=1 obj | 2=2 obj)-- return 2 end--
>PROPORTIONNALon ParamsDOC me theName = "text_note" theScriptname = theName &
"script" theTypeText = "note" isDOC = -1 --(-1=invisible dans la doc| 0=invisible
| 1=visible)-- isGRAPHPAGE = 0 --(0=visible ds page texte | 1=visible ds page
graphique) isCBT = 1 --(1=default) theParams =
[#name:theName,#script:theScriptname,#typetext:theTypetext,#doc:isDOC,#graphpage:is
GRAPHPAGE,#cbt:isCBT] return theParams end -->PARAMS OBJOMBon ParamsLibObjOmb
me theFilled = 1 --(0=evid� | 1=plein) theShapeType = #Rect --(#rect | #roundRect
| #oval | #line)-- theLineSize = 2 --(n=�paisseur du contour) theForecolor =
(color(#rgb, 255, 0, 0)).paletteIndex --(couleur rgb du contour) theBackcolor =
(color(#rgb, 255, 255, 255)).paletteIndex --(couleur rgb du contenu) thePattern =
15 --(1=backcolor = forecolor | 15=backcolor <>= forecolor | n=pattern)--
theBlend = 100 theInk = 0 theParams =
[#filled:theFilled,#shapeType:theShapeType,#linesize:theLineSize,#forecolor:theFore
color,#backcolor:theBackcolor,#pattern:thePattern,#blend:theBlend,#ink:theInk]
return theParamsend-->OBJ CREATIONon CreateLibObj me, theSprite, theMember,
theScriptName, isTextRTF, theText -- tell the stage theScriptText =
member("ActionLibObjScript").text oldItem = the itemdelimiter the
itemdelimiter = "\" theLibrary = castlib(3).filename theLibrary =
theLibrary.item[theLibrary.items.count] the itemdelimiter = oldItem if
theLibrary = -1 then theLibrary = "" -- end tell -->creation newOBJ
theDOCparams = value(me.ParamsDOC()) theObjName = theDOCparams[#name]
theScriptName = theDOCparams[#script] theRect = rect(0, 0, 150, 75)
ParamsLibObjOmb = value(me.ParamsLibObjOmb()) theFilled =
ParamsLibObjOmb[#filled] theShapeType = ParamsLibObjOmb[#shapeType] theLineSize
= ParamsLibObjOmb[#linesize] theForecolor = ParamsLibObjOmb[#forecolor]
theBackcolor = ParamsLibObjOmb[#backcolor] thePattern = ParamsLibObjOmb[#pattern]
theBlend = ParamsLibObjOmb[#blend] theInk = ParamsLibObjOmb[#ink] isSimple
= me.IsSimpleLibObj() if isSimple = 1 then nothing else -->ObjOmb
---->member new(#shape, member(theMember, 3)) member(theMember, 3).name
= theObjName & "_Box"-- member(theMember, 3).scripttext = theScriptText--
member(theMember, 3).purgePriority = 3 member(theMember, 3).rect = theRect
--
[#filled: ;#shapeType: ;#linesize: ;#forecolor: ;#backcolor: ;#pattern ;#blend: ;#i
nk: ] ---->shape member(theMember, 3).filled = theFilled
member(theMember, 3).shapeType = theShapeType member(theMember, 3).linesize =
theLineSize member(theMember, 3).lineDirection = 0 member(theMember,
3).pattern = thePattern ---->sprite sprite(theSprite).member =
member(theMember, 3) sprite(theSprite).linesize = theLinesize
sprite(theSprite).forecolor = theForecolor sprite(theSprite).backcolor =
theBackcolor sprite(theSprite).blend = theBlend sprite(theSprite).ink =
theInk sprite(theSprite).rect = theRect theLocH = ((the stageRight - the
stageLeft) /2) - (theRect[3] /2) theLocV = ((the stageBottom - the stageTop) /2)
- (theRect[4] /2) sprite(theSprite).loc = point(theLocH, theLocV)
sprite(theSprite).rotation = 0 sprite(theSprite).skew = 0
sprite(theSprite).flipH = 0 sprite(theSprite).flipV = 0 -->Obj
theMember = theMember +1 theSprite = theSprite +1 end if -->Obj ----
>member case (isTextRTF) of "textSTD" : new(#field, member(theMember, 3))
"textRTF" : new(#text, member(theMember, 3)) end case member(theMember,
3).name = theObjName-- member(theMember, 3).scripttext = theScriptText--
member(theMember, 3).purgePriority = 3 member(theMember, 3).rect = theRect ----
>text member(theMember, 3).wordwrap = TRUE member(theMember, 3).editable = false
member(theMember, 3).boxtype = #adjust case (isTextRTF) of "textSTD" :
nothing "textRTF" : member(theMember, 3).antialias = TRUE
member(theMember, 3).antiAliasThreshold = 0 end case if theText = "" or
theText = void then nothing else case (member(theMember,
3).type) of #field : member(theMember, 3).text = theText #text :
member(theMember, 3).rtf = theText end case case (member(theMember,
3).type) of #field : member(theMember, 3).rect = rect(0, 0, 400, 0) #text
: member(theMember, 3).width = 400 end case if member(theMember,
3).height > 500 then member(theMember, 3).boxtype = #scroll case
(member(theMember, 3).type) of #field : member(theMember, 3).rect = rect(0,
0, 400, 500) #text : member(theMember, 3).height = 500 end case
theRect = rect(0, 0, member(theMember, 3).width, member(theMember, 3).height)
else nothing end if end if ---->sprite sprite(theSprite).member
= member(theMember, 3) sprite(theSprite).member.forecolor = (color(#rgb, 0, 0,
0)).paletteIndex sprite(theSprite).member.backcolor = (color(#rgb, 255, 255,
255)).paletteIndex sprite(theSprite).blend = 100 sprite(theSprite).ink = 36
sprite(theSprite).rect = theRect theLocH = ((the stageRight - the stageLeft) /2)
- ((theRect[3] - theRect[1]) /2) theLocV = ((the stageBottom - the stageTop) /2) -
((theRect[4] - theRect[2]) /2) sprite(theSprite).loc = point(theLocH, theLocV)
sprite(theSprite).rotation = 0 sprite(theSprite).skew = 0 sprite(theSprite).flipH
= 0 sprite(theSprite).flipV = 0-- updatestage ---->comments if isSimple = 1
then theWidth = sprite(theSprite).right - sprite(theSprite).left
theHeight = sprite(theSprite).bottom - sprite(theSprite).top case (isTextRTF) of
-- "textSTD" : member(theMember, 3).comments = string([#library:theLibrary,
#scriptname:theScriptName, #type:"field", #shadow:0, #deltax:0, #deltay:0,
#width:theWidth, #height:theHeight, #linesize:theLineSize, #clone:0]) --
"textRTF" : member(theMember, 3).comments = string([#library:theLibrary,
#scriptname:theScriptName, #type:"text", #shadow:0, #deltax:0, #deltay:0,
#width:theWidth, #height:theHeight, #linesize:theLineSize, #clone:0]) end case
else -->agrandissement du box theLeft = sprite(theSprite).left -20
theTop = sprite(theSprite).top -20 theRight = sprite(theSprite).right +20
theBottom = sprite(theSprite).bottom +20 theWidth = theRight - theLeft
theHeight = theBottom - theTop sprite(theSprite -1).rect = rect(theLeft, theTop,
theRight, theBottom)-- updatestage myDeltaLoc = sprite(theSprite -1).loc
- sprite(theSprite).loc case (isTextRTF) of "textSTD" : ------
cartouche-- member(theMember -1, 3).comments = string([#library:theLibrary,
#scriptname:theScriptName, #type:"field", #shadow:1, #deltax:myDeltaLoc[1],
#deltay:myDeltaLoc[2], #width:theWidth, #height:theHeight, #linesize:theLinesize,
#clone:0]) ------text-- member(theMember, 3).comments =
string([#library:theLibrary, #scriptname:theScriptName, #type:"field", #shadow:0,
#deltax:myDeltaLoc[1], #deltay:myDeltaLoc[2], #width:theWidth, #height:theHeight,
#linesize:theLineSize, #clone:0]) "textRTF" : ------
cartouche-- member(theMember -1, 3).comments = string([#library:theLibrary,
#scriptname:theScriptName, #type:"text", #shadow:1, #deltax:myDeltaLoc[1],
#deltay:myDeltaLoc[2], #width:theWidth, #height:theHeight, #linesize:theLinesize,
#clone:0]) ------text-- member(theMember, 3).comments =
string([#library:theLibrary, #scriptname:theScriptName, #type:"text", #shadow:0,
#deltax:myDeltaLoc[1], #deltay:myDeltaLoc[2], #width:theWidth, #height:theHeight,
#linesize:theLinesize, #clone:0]) end case end if theParams =
[#sprite:theSprite, #member:theMember] return theParams end--**//rectSelecton
LayersLibObj_Replace me, theSprite, theMember, theScriptName, ParamsList --//init
theId = value((ParamsList[1][#id]).char[4 .. (ParamsList[1][#id]).chars.count])
theLibrary = ParamsList[1][#library] theScript = ParamsList[1][#script]
theTypeText = ParamsList[1][#typeText] theStandard = ParamsList[1][#standard]
theactive = value(ParamsList[1][#active]) theFilename = ParamsList[1][#filename]
theScroll = value(ParamsList[1][#scroll]) theColor = ParamsList[1][#color]
theBkcolor = ParamsList[1][#bkcolor] theBackground = ParamsList[1]
[#background] theX = value(ParamsList[1][#x]) theY = value(ParamsList[1][#y])
theW = value(ParamsList[1][#width]) theH = value(ParamsList[1][#height])
theMarginleft = value(ParamsList[1][#marginleft]) theMarginright =
value(ParamsList[1][#marginright]) theMargintop = value(ParamsList[1][#margintop])
theMarginbottom = value(ParamsList[1][#marginbottom]) theIsdoc =
value(ParamsList[1][#isdoc]) theGraphpage = value(ParamsList[1][#graphpage])
theXdoc = value(ParamsList[1][#xdoc]) theYdoc = value(ParamsList[1][#ydoc])
theWdoc = value(ParamsList[1][#wdoc]) theHdoc = value(ParamsList[1][#hdoc])
theIscbt = value(ParamsList[1][#iscbt]) theRtf = ParamsList[1][#rtf] -->Obj
---->sprite sprite(theSprite).member = member(theMember, 3)
sprite(theSprite).blend = 100 if theBkcolor = "-1" or theBkcolor = void then
sprite(theSprite).ink = 36 else
sprite(theSprite).ink = 0theBkcolor = HexaToDec(theBkcolor)
sprite(theSprite).member.backcolor = theBkcolor end if theTextX = theXdoc +
theMarginleft theTextY = theYdoc + theMarginTop theTextW = theWdoc -
theMarginLeft + theMarginRight theTextH = theHdoc - theMarginTop + theMarginBottom
case (theScroll) of 1 : sprite(theSprite).member.rect = rect(0, 0, theTextW -
16, theTextH) 0 : sprite(theSprite).member.rect = rect(0, 0, theTextW,
theTextH) end case case (member(theMember, 3).type) of #field : nothing
#text : sprite(theSprite).member.height = theTextH end case
sprite(theSprite).loc = point(theTextX, theTextY) sprite(theSprite).rotation = 0
sprite(theSprite).skew = 0 sprite(theSprite).flipH = 0 sprite(theSprite).flipV =
0-- updatestage isSimple = me.IsSimpleLibObj() if isSimple = 1 then
nothing else ParamsLibObjOmb = value(me.ParamsLibObjOmb()) theFilled =
ParamsLibObjOmb[#filled] theShapeType = ParamsLibObjOmb[#shapeType] theLineSize
= ParamsLibObjOmb[#linesize] theForecolor = ParamsLibObjOmb[#forecolor]
theBackcolor = ParamsLibObjOmb[#backcolor] thePattern = ParamsLibObjOmb[#pattern]
theBlend = ParamsLibObjOmb[#blend] theInk = ParamsLibObjOmb[#ink] ----
>cartouche sprite(theSprite -1).member = member(theMember -1, 3)
sprite(theSprite -1).linesize = theLineSize sprite(theSprite -1).forecolor =
theForecolor sprite(theSprite -1).backcolor = theBackcolor sprite(theSprite -
1).blend = theBlend sprite(theSprite -1).ink = theInk sprite(theSprite -
1).rect = rect(theXdoc, theYdoc, theXdoc + theWdoc, theYdoc + theHdoc)
sprite(theSprite -1).rotation = 0 sprite(theSprite -1).skew = 0
sprite(theSprite -1).flipH = 0 sprite(theSprite -1).flipV = 0-- updatestage
end if --IsTiming IsTiming = 0 return IsTimingend
--////////////////////////////////////////////////////////---- Modif
Obj dans l'EDITEUR --
--////////////////////////////////////////////////////////----**//Boxtypeon
RectOcxToLibObj me, theSprite, theMember, theParams theLocH =
value(theParams[#Xposition]) theLocV = value(theParams[#Yposition]) theWidth =
value(theParams[#Wposition]) theHeight = value(theParams[#Hposition]) isSimple =
me.IsSimpleLibObj() case (sprite(theSprite).member.type) of #text, #field :
if isSimple <> 1 then myDeltaLoc = sprite(theSprite -1).loc -
sprite(theSprite).loc case (sprite(theSprite).member.boxtype) of
#scroll : theTextWidth = theWidth -16 #adjust : theTextWidth = theWidth
end case sprite(theSprite).member.rect = rect(theLocH, theLocV,
theLocH + theTextWidth, theLocV + theHeight) sprite(theSprite).rect =
sprite(theSprite).member.rect case (member(theMember, 3).type) of
#field : nothing #text : sprite(theSprite).member.height = theHeight
end case if isSimple <> 1 then sprite(theSprite -1).loc = point(theLocH,
theLocV) + myDeltaLoc sprite(theSprite).loc = point(theLocH, theLocV)--
updatestage #shape : sprite(theSprite).rect = rect(theLocH, theLocV,
theLocH + theWidth, theLocV + theHeight) sprite(theSprite).loc =
point(theLocH, theLocV)-- updatestage --maj comments--
theComments = value(sprite(theSprite).member.comments) theComments[#deltax] =
sprite(theSprite).loch - sprite(theSprite +1).loch theComments[#deltay] =
sprite(theSprite).locv - sprite(theSprite +1).locv theComments[#width] =
theWidth theComments[#height] = theHeight--
sprite(theSprite).member.comments = string(theComments) theComments[#shadow] =
0-- sprite(theSprite +1).member.comments = string(theComments) end case
--rectSelect -- me.RectSelectLibObj(theSprite, theMember) theParamsToReturn
= [#Xposition:theLocH, #Yposition:theLocV, #Wposition:theWidth,
#Hposition:theHeight] --maj OCX return theParamsToReturn end--**//rtfon
RtfOcxToLibObj me, theSprite, theMember, theParams, theParamRtf case
(sprite(theSprite).member.type) of #field : -->FORMATTAGE LIST isRTF =
"textSTD"theText = AnalyseCsRev(theParams[#text], isRTF)
sprite(theSprite).member.text = theText theAlignment =
theParams[#alignment] case (theAlignment) of 0 : theAlignment = "left"
2 : theAlignment = "center" 1 : theAlignment = "right" end case
theBold = theParams[#bold] theItalic = theParams[#italic] theUnderline =
theParams[#underline] sprite(theSprite).member.FONTSTYLE = "plain"
if theBold = 0 then theFormattage = "plain" if theItalic = 0
then if theUnderline = 1 then theFormattage = "underline"
else theFormattage = "italic" if theUnderline = 1 then
theFormattage = "italic, underline" end if else if
theItalic = 0 then theFormattage = "bold" if theUnderline = 1
then theFormattage = "bold, underline" else theFormattage
= "bold, italic" if theUnderline = 1 then theFormattage = "bold, italic,
underline" end if end if if not(voidP(theParams[#face]))
then sprite(theSprite).member.FONT = theParams[#face] if
not(voidP(theParams[#size])) then sprite(theSprite).member.FONTSIZE =
theParams[#size] sprite(theSprite).member.FONTSTYLE = theFormattage
sprite(theSprite).member.ALIGNMENT = theAlignment -->X2402
theForeColor = theParams[#framecolor] if not(integerP(theForeColor)) then
if theForeColor.chars.count = 6 then theForeColor = HexaToDec(theForeColor)
end if end if sprite(theSprite).member.FORECOLOR = theForeColor -->
theParams = theParams[#backcolor] #text : sprite(theSprite).member.rtf =
theParamRtf end case if member(theMember, 3).text = "" then
nothing else repeat while member(theMember, 3).char[member(theMember,
3).text.chars.count] = numtochar(13) delete member(theMember,
3).char[member(theMember, 3).text.chars.count] if member(theMember, 3).text =
"" then exit repeat end repeat end if -- updatestage if theParams = -1
then sprite(theSprite).member.backcolor = (color(#rgb, 255, 255,
255)).paletteIndex sprite(theSprite).ink = 36 else -->X2402 if
not(integerP(theParams)) then if theParams.chars.count = 6 then theParams =
HexaToDec(theParams) end if end if sprite(theSprite).member.backcolor =
theParams --> sprite(theSprite).ink = 0 end if -- updatestage
--rectSelect -- me.RectSelectLibObj(theSprite, theMember) end
--////////////////////////////////////////////////////////---- Modif
Obj dans le PLAYER --
--////////////////////////////////////////////////////////----**//Localisation

You might also like