Centering by Word in Canvas

David McFarlane mcfarla9 at msu.edu
Tue Oct 8 14:32:35 UTC 2013


Brendan,

Look at the Canvas.CalculateTextSize topic in the E-Basic Help facility.

-----
David McFarlane
E-Prime training 
online:  http://psychology.msu.edu/Workshops_Courses/eprime.aspx
Twitter:  @EPrimeMaster (https://twitter.com/EPrimeMaster)

/----
Stock reminder:  1) I do not work for PST.  2) PST's trained staff 
take any and all questions at https://support.pstnet.com , and they 
strive to respond to all requests in 24-48 hours, so make full use of 
it.  3) In addition, PST offers several instructional videos on their 
YouTube channel (http://www.youtube.com/user/PSTNET ).  4) If you do 
get an answer from PST staff, please extend the courtesy of posting 
their reply back here for the sake of others.
\----


At 10/8/2013 09:32 AM Tuesday, Brendan T wrote:
>I have a small problem in my experiment design I was hoping you guys 
>could shed some light on.
>
>My project uses the canvas function to display both words and 
>circles around the word (big enough to be in the periphery) but the 
>problem is that canvas doesn't allow you to align words to the 
>center. It produces words on the canvas as such:
>
>cnvs.Text Display.XRes/2, Displaly.YRes/2, c. getattrib("WordList1")
>'This pulls a word from wordList1 and puts it in the center of the 
>screen such that the first letter is centered at XRes/2, YRes/2
>
>
>This centers the image based on the number of pixels on the screen, 
>which is fine (and necessary) for my circle but aligns the words 
>such that the first letter of the word is at the center. Words can 
>be easily aligned in the display feature, but canvas is necessary 
>for my other stimuli.
>
>Does anybody know how this might be fixed such that the word is 
>centered in canvas, regardless of word length? Is it possible to 
>overlay a regular display with canvas? Or perhaps a way to factor 
>word length in and subtract half of it from XRes/2?
>
>I appreciate any feedback and I hope the issue is clear.
>
>Thank you!!
>Brendan

-- 
You received this message because you are subscribed to the Google Groups "E-Prime" group.
To unsubscribe from this group and stop receiving emails from it, send an email to e-prime+unsubscribe at googlegroups.com.
To post to this group, send email to e-prime at googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/e-prime/52541789.6801320a.10b1.184cSMTPIN_ADDED_MISSING%40gmr-mx.google.com.
For more options, visit https://groups.google.com/groups/opt_out.



More information about the Eprime mailing list