iiv03 Posted December 4, 2018 Share Posted December 4, 2018 hey i need to change position this picture but i have this cods in gamemode race code gamemode local width = dxGetTextWidth(" ".._MapName.." - REDO",findFontToHeight(fonts["normal"][1],y*0.01)*2.0,fonts["normal"][1],false) dxDrawText(" ".._MapName.." - REDO",s*0.004,y*0.976-race.notPos,s,y,tocolor(0,0,0,255*alpha),findFontToHeight(fonts["normal"][1],y*0.01)*2.0,fonts["normal"][1],"left","top",false,false,false,true) dxDrawText(" "..MapColor(_MapName).."#ffffff - #00ee00REDO",s*0.004,y*0.975-race.notPos,s,y,tocolor(r,g,b,255*alpha),findFontToHeight(fonts["normal"][1],y*0.01)*2.0,fonts["normal"][1],"left","top",false,false,false,true) and this picture dxDrawImage(4, 699, 23, 21, "img/map.png", 0, 0, 0, tocolor(0,102,255,255*alpha), false) i try with this dxDrawImage(s*320,y*0.9,s*0.017,y*34.285, "img/map.png", 0, 0, 0, tocolor(0,102,255,255*alpha), false) and my resoulation is : 1280x720 but problem picture not show Link to comment
Investor Posted December 5, 2018 Share Posted December 5, 2018 dxDrawImage(s*320,y*0.9,s*0.017,y*34.285, "img/map.png", 0, 0, 0, tocolor(0,102,255,255*alpha), false) That's because s*320 is way outside the viewable area. Indeed, it's placed, 320 times the screen width, to the left. The value you multiply by should be a float between 0 and 1. Link to comment
iiv03 Posted December 5, 2018 Author Share Posted December 5, 2018 3 hours ago, Investor said: dxDrawImage(s*320,y*0.9,s*0.017,y*34.285, "img/map.png", 0, 0, 0, tocolor(0,102,255,255*alpha), false) That's because s*320 is way outside the viewable area. Indeed, it's placed, 320 times the screen width, to the left. The value you multiply by should be a float between 0 and 1. Well how is there a database for this or what I want tutorial^^ Link to comment
Investor Posted December 5, 2018 Share Posted December 5, 2018 (edited) What do you mean? This is pretty basic math. If s is the width of the screen in pixels, say, 1920px, then 320×1920 would be placed 614,400 pixels to the right of the screen's left edge (origin is top-left corner), where the screen only has 1920 pixels. Goes beyond the viewable area by 320 lengths of the screen. The wiki page for dxDrawImage clearly states that the first parameter is the X position, that is, how many pixels from the left edge should it be displayed. Edited December 5, 2018 by Investor 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