NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > NinjaScript Development Support > General Programming

General Programming General NinjaScript programming questions.

Reply
 
Thread Tools Display Modes
Old 05-28-2012, 03:14 AM   #1
daglas
Senior Member
 
Join Date: Mar 2011
Location: Ukraine
Posts: 146
Thanks: 19
Thanked 2 times in 2 posts
Default change font for drawtextfixed

Dear friends.
I use DrawTextFixed, and I want to change font style. I want to change font size and change color. I have read manual, but when I try to use some font data I have troubles.
Could you provide to me some sample?
daglas is offline  
Reply With Quote
Old 05-28-2012, 04:05 AM   #2
NinjaTrader_Joydeep
NinjaTrader Customer Service
 
NinjaTrader_Joydeep's Avatar
 
Join Date: Dec 2011
Location: India
Posts: 3,286
Thanks: 580
Thanked 546 times in 541 posts
Default

Hello daglas,
Thanks for writing in and I am happy to assist you.

Please use the below overload to change the font size while drawing a DrawTextField

Quote:
DrawTextFixed(string tag, string text, TextPosition textPosition, Color textColor, Font font, Color outlineColor, Color areaColor, int areaOpacity)
http://www.ninjatrader.com/support/h...wtextfixed.htm

Please refer to this sample code which demonstrates how to change the font in the NinjaScript code.
http://ninjatrader.com/support/forum...ad.php?t=19170
NinjaTrader_Joydeep is offline  
Reply With Quote
Old 05-28-2012, 04:54 AM   #3
daglas
Senior Member
 
Join Date: Mar 2011
Location: Ukraine
Posts: 146
Thanks: 19
Thanked 2 times in 2 posts
Default

Thanks for help.
I have try such construction
DrawTextFixed("prob1","probability for range",x,TextPosition.TopLeft,Color.Green,largeFon t);
And I have error message - DrawTextFixed can get 5 arguments.
daglas is offline  
Reply With Quote
Old 05-28-2012, 05:16 AM   #4
NinjaTrader_Joydeep
NinjaTrader Customer Service
 
NinjaTrader_Joydeep's Avatar
 
Join Date: Dec 2011
Location: India
Posts: 3,286
Thanks: 580
Thanked 546 times in 541 posts
Default

Hello daglas,
You have missed to define the outline color, area color and the opacity.

Please modify your code to
Code:
DrawTextFixed("prob1","probability for range",x,TextPosition.TopLeft,Color.Green,largeFont, Color.Blue, Color.Blue, 3);
http://www.ninjatrader.com/support/h...wtextfixed.htm
NinjaTrader_Joydeep is offline  
Reply With Quote
The following user says thank you to NinjaTrader_Joydeep for this post:
Old 05-28-2012, 06:07 AM   #5
sledge
Senior Member
 
Join Date: Aug 2010
Location: Washington, D.C.
Posts: 1,179
Thanks: 178
Thanked 299 times in 257 posts
Default

I count 9 parameters.

this x parameter makes no sense here, or in the original statements.


Quote:
Originally Posted by NinjaTrader_Joydeep View Post
Hello daglas,
You have missed to define the outline color, area color and the opacity.

Please modify your code to
Code:
DrawTextFixed("prob1","probability for range",x,TextPosition.TopLeft,Color.Green,largeFont, Color.Blue, Color.Blue, 3);
http://www.ninjatrader.com/support/h...wtextfixed.htm
sledge is online now  
Reply With Quote
Old 05-28-2012, 06:10 AM   #6
daglas
Senior Member
 
Join Date: Mar 2011
Location: Ukraine
Posts: 146
Thanks: 19
Thanked 2 times in 2 posts
Default

Quote:
Originally Posted by NinjaTrader_Joydeep View Post
Hello daglas,
You have missed to define the outline color, area color and the opacity.

Please modify your code to
Code:
DrawTextFixed("prob1","probability for range",x,TextPosition.TopLeft,Color.Green,largeFont, Color.Blue, Color.Blue, 3);
http://www.ninjatrader.com/support/h...wtextfixed.htm
Many thanks, everything works good.
daglas is offline  
Reply With Quote
The following user says thank you to daglas for this post:
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to change font bubblegum Indicator Development 2 04-16-2011 12:30 PM
Change Font Size ghunt Strategy Development 2 08-04-2010 10:22 AM
DrawTextFixed BigMike Indicator Development 7 04-01-2010 10:01 AM
DrawTextFixed rt-trader General Programming 5 01-21-2008 10:46 PM
DrawText...Font...how do you use the font param? Can't find any examples funk101 General Programming 8 05-29-2007 07:10 AM


All times are GMT -6. The time now is 03:59 PM.