Feche1320 Posted April 28, 2011 Share Posted April 28, 2011 So, I have a text, if my resolution is on 800x600 the text is where it has to be, but if I change it to another, the text will simply 'move', making it to be almost on the middle of the screen.. Thanks. Link to comment
Castillo Posted April 28, 2011 Share Posted April 28, 2011 I had this problem before, but a guy in the forums helped me, here's the topic: viewtopic.php?f=91&t=32132&hilit=resolution Link to comment
Feche1320 Posted April 28, 2011 Author Share Posted April 28, 2011 From 1024*768 and up the text draw is OK, but from 800*600 to 640*480 it isn't showing.. drawColor("#2EFE2EEG #FFFFFF24/7 RACE DD/DM", (754/1024)*sxx-50, (228/768)*syy-210, (732/1024)*sxx, (258/768)*syy, tocolor(0,0,0,255), (sxx/1024)*0.8, "bankgothic") Link to comment
Moderators Citizen Posted April 28, 2011 Moderators Share Posted April 28, 2011 From 1024*768 and up the text draw is OK, but from 800*600 to 640*480 it isn't showing.. drawColor("#2EFE2EEG #FFFFFF24/7 RACE DD/DM", (754/1024)*sxx-50, (228/768)*syy-210, (732/1024)*sxx, (258/768)*syy, tocolor(0,0,0,255), (sxx/1024)*0.8, "bankgothic") the sxx-50 don't have the same effect in 800*600 and in1024*768 You have to convert the absolute position x, y to a relative position, then convert the relative position to the absolute position ( but for the player screen size ) drawColor ? ( custom function ? ) drawColor("#2EFE2EEG #FFFFFF24/7 RACE DD/DM", (754/1024)*sxx-50, (228/768)*syy-210, (732/1024)*sxx, (258/768)*syy, tocolor(0,0,0,255), (sxx/1024)*0.8, "bankgothic") As you can see, the blue is not at the good place ! All positions modifications need to be before the relative conversion ( like this ): (754-50/1024)*sxx => (704/1024)*sxx (228-210/768)*syy => (18/768)*sxx I supposed that in in 1024*768 the text is at the good place so try whit this. (It's more easy with colors isn't it ? ) Link to comment
Feche1320 Posted April 28, 2011 Author Share Posted April 28, 2011 Lol it works, thank you Just a little question.. dxDrawText("My text", x, y, XX, YY) For what is it the XX and YY? Is it fine if I put there the sxx and syy variables? Link to comment
Moderators Citizen Posted April 28, 2011 Moderators Share Posted April 28, 2011 right: the absolute X coordinate of the right side of the text bounding box. Used for text aligning, clipping and word breaking.bottom: the absolute Y coordinate of the bottom side of the text bounding box. Used for text aligning, clipping and word breaking. It's set the size of a 'rectangle' ( the bounding box ). This 'rectangle' is needed if you want to use this arguments: clip: if set to true, the parts of the text that don't fit within the bounding box will be cut off.wordBreak: if set to true, the text will wrap to a new line whenever it reaches the right side of the bounding box. If false, the text will always be completely on one line. And if you want to center the text to the middle, left or right of this 'rectangle'. I think you don't want to use it so you can use sxx and syy. Link to comment
Feche1320 Posted April 28, 2011 Author Share Posted April 28, 2011 Ah, you made me understand EVERYTHING. Thank you, a lot Link to comment
Moderators Citizen Posted April 29, 2011 Moderators Share Posted April 29, 2011 Hehe thanks No problem Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now