Button Click -> opens chatbox
Hello, Im trying to make a event if you click CTRL then the chat opens, but If you press it again the chat will disappear.
Replies (9)
Last message on 28 Mar 2018
Size43
(Administrator)
on
24 Dec 2017, 16:04:40
If you want to hide the entire chat, not just activate/deactivate typing, you can use
gms_draw_toggle to disable automatic chat drawing, and then draw it manually using
gms_chat_draw.
How do I do that? I tried this but the chat came up but 1 second disappeared.
(Step Event)
enable = false
if keyboard_check_pressed(vk_control)
{
enable = true
gms_chat_toggle(enable)
gms_chat_draw()
}
else
{
enable = false
gms_chat_toggle(enable)
gms_chat_draw()
}
Size43
(Administrator)
on
28 Mar 2018, 19:25:56
You'll still need gms_chat_draw in the draw event (only if you've disabled automatic chat drawing).
Try something like this:
// Create
enable = false
// Step
if keyboard_check_pressed(vk_control)
{
enable = not enable
gms_chat_toggle(enable)
}
if keyboard_check_pressed(vk_control)
{
enable = true
gms_chat_toggle(enable)
gms_chat_draw()
}
//Then do
if enable = true
{
gms_chat_toggle(enable)
gms_chat_draw()
}
You could remove a lot of the keyboard check code too
if keyboard_check_pressed(vk_control)
{
if enable = true {
enable = false
} else {
enable = true
}
}
You can simply do :
if keyboard_check_pressed(vk_control)
{
enable = not enable;
}
//This will make it true if it's false , or false if it's true
In what event do I need to put it? Step? Create?
step to be constantly updated i think
Hey there,
To do this you could use
gms_chat_keys(vk_control, vk_enter, 0)
.