Hey a Small Suggestion;
could be there add a function for Highres so that the Screen first detect if the Player can see highres and then set it to Highres or Normal ?
not sure if that can be done.
i did Try it with this, but it didnt work :
--@name
function drawHighres()
--@highres
end
if CLIENT then
function Render()
render.clear()
render.setColor(255,255,255)
render.drawRect(256,256,150,150)
if render.getIsHighRes() == true then
render.setColor(255,0,0)
render.drawRect(256,256,150,150)
end
end
A,B = render.getScreenRes()
print(A,B)
if A > 1024 and B > 1024 then
drawHighres()
timer.create("drawScreen",1,1,function() hook("render","render",Render) end)
elseif A < 1024 and B < 1024 then
timer.create("drawScreen",1,1,function() hook("render","render",Render) end)
end
render.drawRect(256,256,150,150)
if render.getIsHighRes() == true then
render.setColor(255,0,0)
render.drawRect(256,256,150,150)
end
end
A,B = render.getScreenRes()
print(A,B)
if A > 1024 and B > 1024 then
drawHighres()
timer.create("drawScreen",1,1,function() hook("render","render",Render) end)
elseif A < 1024 and B < 1024 then
timer.create("drawScreen",1,1,function() hook("render","render",Render) end)
end
end
so people can read it;
--@name
function drawHighres()
--@highres
end
if CLIENT then
function Render()
render.clear()
render.setColor(255,255,255)
render.drawRect(256,256,150,150)
if render.getIsHighRes() == true then
render.setColor(255,0,0)
render.drawRect(256,256,150,150)
end
end
A,B = render.getScreenRes()
print(A,B)
if A > 1024 and B > 1024 then
drawHighres()
timer.create("drawScreen",1,1,function() hook("render","render",Render) end)
elseif A < 1024 and B < 1024 then
timer.create("drawScreen",1,1,function() hook("render","render",Render) end)
end
end
This won't set the screen to highres if the user can't see it. If you want to enable/disable highres during code you need to write a specialized emitter which uses a rendertarget.
Oh, and obviously (for screens) you can test if you're in hig-res mode with
To add to what Kosmos said, the pre-processor directives are not code. You can't conditionally execute them, as they're just meta-data that tells Starfall what needs to be setup before any code is executed.
Thus, putting --@highres in a function is meaningless.