对于对在电视、广告牌上绘图感兴趣的人来说……这里的关键是使用渲染目标。
我整理了一个包含一些基本示例 785 的存储库来帮助开发人员入门。
我要感谢@davedumas1,他在他的电影和地堡脚本中使用了它们,并提供了渲染目标列表。
cinscreen
npcphone
tvscreen
ex_tvscreen
gr_trailer_monitor_01
gr_trailer_monitor_02
gr_trailer_monitor_03
gr_trailerTV_01
gr_trailerTV_02
prop_clubhouse_laptop_01a
gr_bunker_laptop_01a
Prop_ImpExp_Lappy_01a
prop_ex_computer_screen
clubname_blackboard_01a
memorial_wall_president
memorial_wall_vice_president
memorial_wall_active_01
memorial_wall_active_02
memorial_wall_active_03
clubhouse_table
Prop_Screen_DCTL
prop_ex_computer_screen
prop_ex_office_text
clubhouse_Plan_01a
port_text
starb_text
stern_text
taxi
digiscanner
ECG
blimp_text
ID_Text
ID_Text_02
lua:
function CreateNamedRenderTargetForModel(name, model)
local handle = 0
if not IsNamedRendertargetRegistered(name) then
RegisterNamedRendertarget(name, 0)
end
if not IsNamedRendertargetLinked(model) then
LinkNamedRendertarget(model)
end
if IsNamedRendertargetRegistered(name) then
handle = GetNamedRendertargetRenderId(name)
end
return handle
end
-- TV in Jimmys room
Citizen.CreateThread(function ()
local model = GetHashKey("des_tvsmash_start"); -- 2054093856
local pos = { x = -810.59, y = 170.46, z = 77.25 };
local entity = GetClosestObjectOfType(pos.x, pos.y, pos.z, 0.05, model, 0, 0, 0)
local handle = CreateNamedRenderTargetForModel("tvscreen", model)
while true do
SetTextRenderId(handle) -- set render target
Set_2dLayer(4)
Citizen.InvokeNative(0xC6372ECD45D73BCD, 1)
DrawRect(0.5, 0.5, 1.0, 0.5, 255, 0, 0, 255); -- WOAH!
SetTextRenderId(GetDefaultScriptRendertargetRenderId()) -- reset
Citizen.InvokeNative(0xC6372ECD45D73BCD, 0)
Citizen.Wait(0)
end
end)
我要感谢@davedumas1,他在他的电影和地堡脚本中使用了它们,并提供了渲染目标列表。
cinscreen
npcphone
tvscreen
ex_tvscreen
gr_trailer_monitor_01
gr_trailer_monitor_02
gr_trailer_monitor_03
gr_trailerTV_01
gr_trailerTV_02
prop_clubhouse_laptop_01a
gr_bunker_laptop_01a
Prop_ImpExp_Lappy_01a
prop_ex_computer_screen
clubname_blackboard_01a
memorial_wall_president
memorial_wall_vice_president
memorial_wall_active_01
memorial_wall_active_02
memorial_wall_active_03
clubhouse_table
Prop_Screen_DCTL
prop_ex_computer_screen
prop_ex_office_text
clubhouse_Plan_01a
port_text
starb_text
stern_text
taxi
digiscanner
ECG
blimp_text
ID_Text
ID_Text_02
-- act_cinema.ctarget = "cinscreen"; model = GetHashKey("v_ilev_cin_screen") - Pastebin.com
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
pastebin.com