Team Spartan Cookies & Milk Forums
  • Issue Tracker
  • Donations
  • Search
  • Member List
  • Help

Register

Team Spartan Cookies & Milk Forums Garry's Mod Starfall v
« Previous 1 … 8 9 10 11 12 … 18 Next »
Function Request
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Threaded Mode
Function Request
06-08-2016, 03:42 AM, (This post was last modified: 06-08-2016, 03:51 AM by 4N0NYM.)
#1
4N0NYM Offline
absens
****
Posts: 561
Threads: 211
Joined: Dec 2014
Function Request
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


end
Find
Reply
06-08-2016, 04:03 AM,
#2
TheOneAndOnlyTee Offline
GMod Admin
Posts: 755
Threads: 47
Joined: Oct 2013
RE: Function Request
(06-08-2016, 03:42 AM)4N0NYM Wrote:

--@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

   

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

Steam Profile
My Discord Server
Need help with E2 or SF? , just ask me and i'll try to help.
[Image: 98Dkcoz.gif]
Find
Reply
06-08-2016, 10:45 AM,
#3
Knight Offline
Valued donator and member
****
Posts: 397
Threads: 21
Joined: Nov 2013
RE: Function Request
(06-08-2016, 04:03 AM)T-18 Wrote: so people can read it;

You always write such pretty code :)




Find
Reply
06-08-2016, 11:46 AM,
#4
Kosmos Offline
GMod Admin
Posts: 180
Threads: 3
Joined: Dec 2013
RE: Function Request
There is a function for that:
Code:
--@highres
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
Code:
render.getIsHighRes()
Find
Reply
06-08-2016, 03:18 PM,
#5
Person8880 Offline
gpj.ecafllorT
*******
Posts: 2,407
Threads: 45
Joined: Sep 2013
RE: Function Request
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.
Find
Reply
« Next Oldest | Next Newest »


  • View a Printable Version
Forum Jump:


Users browsing this thread:
Contact UsTeam Spartan Cookies & MilkReturn to TopLite (Archive) ModeMark all forums readRSS Syndication

Powered By MyBB, © 2002-2026 MyBB Group.