Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently May 17th, 2024, 12:02 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: (opus2.81) can someone help me with this simple script?
PostPosted: November 10th, 2004, 7:43 pm 
Offline

Joined: November 10th, 2004, 6:50 pm
Posts: 7
hy everyone,
can someone help me with this simple script problem?
i tried to do it by myself but i couldnt do it, can someone send me the imp.file of this script? i have opus 2.81.

"Can you change the color of a text with scripting, or a vector?"

To change the colour of a text object, simply use the SetColour() function as follows:

colour = RGB(0,0,255)
//you should change these RGB values to the required colour
Text_1.SetColour(colour)
//where Text_1 is the name of the text object you wish to change

To change the fill colour or line colour of a polygon, use the SetFillColour() and SetLineColour() functions as follows:

colour = RGB(0,0,255)
//you will again need to change this to your required colour
Polygon.SetFillColour(colour)
Polygon.SetLineColour(colour)
//where Polygon is the name of the polygon you would like to change

cheers
sherif


For this message b777sherif has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: November 10th, 2004, 9:35 pm 
Offline

Joined: October 25th, 2004, 12:27 pm
Posts: 526
Location: Digital Workshop
Hi,

Thank you for your enquiry.

SetColour(), SetFillColour() and SetLineColour() are all 04-specific script functions and cannot be used in Opus Pro 2.81 or Opus Pro XE 2.81.

To change the colour of text in 2.81, you will need to use the following script:

Code:
Text.SetSelection(0,-1) //selects all of the text in the object 'Text'
newstyle = new Object() //creates a new object named 'newstyle'
newstyle.colour = "FF0000" //sets the colour property of this new object to bright red
Text.SetSelectionStyle(newstyle) //sets the selected text to the same properties as the 'newstyle' object


As you can see, you will need to know the HTML code for your required text colour, rather than dealing in RGB values.

There are no equivalents of the SetFillColour() and SetLineColour() functions in version 2.81, so I'm afraid that you will not be able to directly modify the colour properties of a vector object at runtime.

I hope this helps. Please do not hesitate to contact me if you have any further queries.

Kind regards,

_________________
Robin Garrett
Digital Workshop Technical Support


For this message Robin Garrett has been thanked by : mackavi


Top
 Profile Visit website  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Majestic-12 [Bot] and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group