Add files via upload
This commit is contained in:
parent
ac737d447a
commit
ec98f4ea7c
39
client/conf.lua
Normal file
39
client/conf.lua
Normal file
@ -0,0 +1,39 @@
|
||||
function love.conf(t)
|
||||
t.identity = nil -- The name of the save directory (string)
|
||||
t.version = "0.10.1" -- The LOVE version this game was made for (string)
|
||||
t.console = true -- Attach a console (boolean, Windows only)
|
||||
|
||||
t.window.title = "game" -- The window title (string)
|
||||
t.window.icon = nil -- Filepath to an image to use as the window's icon (string)
|
||||
t.window.width = 400 -- The window width (number)
|
||||
t.window.height = 600 -- The window height (number)
|
||||
t.window.borderless = false -- Remove all border visuals from the window (boolean)
|
||||
t.window.resizable = false -- Let the window be user-resizable (boolean)
|
||||
t.window.minwidth = 1 -- Minimum window width if the window is resizable (number)
|
||||
t.window.minheight = 1 -- Minimum window height if the window is resizable (number)
|
||||
t.window.fullscreen = false -- Enable fullscreen (boolean)
|
||||
t.window.fullscreentype = "desktop" -- Standard fullscreen or desktop fullscreen mode (string)
|
||||
t.window.vsync = false -- Enable vertical sync (boolean)
|
||||
t.window.fsaa = 0 -- The number of samples to use with multi-sampled antialiasing (number)
|
||||
t.window.display = 1 -- Index of the monitor to show the window in (number)
|
||||
t.window.highdpi = false -- Enable high-dpi mode for the window on a Retina display (boolean)
|
||||
t.window.srgb = false -- Enable sRGB gamma correction when drawing to the screen (boolean)
|
||||
t.window.x = nil -- The x-coordinate of the window's position in the specified display (number)
|
||||
t.window.y = nil -- The y-coordinate of the window's position in the specified display (number)
|
||||
|
||||
t.modules.audio = true -- Enable the audio module (boolean)
|
||||
t.modules.event = true -- Enable the event module (boolean)
|
||||
t.modules.graphics = true -- Enable the graphics module (boolean)
|
||||
t.modules.image = true -- Enable the image module (boolean)
|
||||
t.modules.joystick = true -- Enable the joystick module (boolean)
|
||||
t.modules.keyboard = true -- Enable the keyboard module (boolean)
|
||||
t.modules.math = true -- Enable the math module (boolean)
|
||||
t.modules.mouse = true -- Enable the mouse module (boolean)
|
||||
t.modules.physics = true -- Enable the physics module (boolean)
|
||||
t.modules.sound = true -- Enable the sound module (boolean)
|
||||
t.modules.system = true -- Enable the system module (boolean)
|
||||
t.modules.timer = true -- Enable the timer module (boolean)
|
||||
t.modules.window = true -- Enable the window module (boolean)
|
||||
t.modules.thread = true -- Enable the thread module (boolean)
|
||||
end
|
||||
--1440 x 2560
|
||||
42
client/main.lua
Normal file
42
client/main.lua
Normal file
@ -0,0 +1,42 @@
|
||||
-- This is a comment
|
||||
--This is the test client code!
|
||||
require("Libs/Library") -- One of the defualt libraies that i load... Not needed for this project
|
||||
require("Libs/Utils") -- One of the defualt libraies that i load... Not needed for this project
|
||||
require("Libs/bin") -- One of the defualt libraies that i load... Not needed for this project
|
||||
require("Libs/MultiManager") -- allows for multitasking
|
||||
require("Libs/lovebind") -- binds my libraies to the love2d engine that i am using
|
||||
require("GuiManager") -- allows the use of graphics in the program.
|
||||
require("net") -- Loads the networking library
|
||||
require("net.chatting")
|
||||
client=net:newTCPClient("localhost",12345) -- Connects to the server
|
||||
if type(client)=="boolean" then error("Please run the server file first!") end
|
||||
client.OnChatRecieved(function(user,msg) -- hook to grab chat data
|
||||
mainapp.chatFrame.text=mainapp.chatFrame.text..user..": "..msg.."\n"
|
||||
end)
|
||||
gui.enableAutoWindowScaling(true) -- allows mobile support. Not needed for PC use
|
||||
function InitEngine()
|
||||
mainapp=gui:newFrame("",0,0,0,0,0,0,1,1) -- creates a frame that takes up the enitre window
|
||||
mainapp.header=mainapp:newTextLabel("Chat Program",0,0,0,20,0,0,1) -- creates the header for the app
|
||||
mainapp.header.Tween=-3 -- moves the text up by a factor of 3 pixels
|
||||
mainapp.header.Color=Color.Lighten(Color.Blue,.25) -- Sets the Color of the header object to light blue
|
||||
mainapp.chatFrame=mainapp:newTextLabel("",0,20,0,-20,0,0,1,1) -- creates the chat frame where users can see the text that is sent
|
||||
mainapp.chatFrame.Color=Color.Lighten(Color.Brown,.15) -- Color stuff
|
||||
mainapp.chatFrame.Tween=-3 -- text positioning
|
||||
mainapp.chatFrame.TextFormat="left" -- changes the text format to left hand side of screen
|
||||
mainapp.textbox=mainapp:newTextBox("",5,-35,-10,30,0,1,1) -- creates a textbox that allows the user to be able to send messages
|
||||
mainapp.textbox.TextFormat="left" -- sets the format to left hand side of screen
|
||||
mainapp.textbox.Color=Color.tan
|
||||
mainapp.textbox:setRoundness(5,5,360)
|
||||
mainapp.textbox:OnEnter(function(self,txt) -- handles the send event
|
||||
client:sendChat("NAMENOSPACE",txt) -- sends the data to the server
|
||||
self.text=""
|
||||
self.Color=Color.tan
|
||||
end)
|
||||
mainapp.textbox:OnFocus(function(self)
|
||||
self.Color=Color.Lighten(Color.tan,.25)
|
||||
end)
|
||||
mainapp.textbox.ClearOnFocus=true
|
||||
mainapp.textbox.XTween=2
|
||||
mainapp.textbox.Tween=2 -- positions the text in the text box
|
||||
--This displays the chatting frame and allows connection to the server... Look at server.lua to see the servers code
|
||||
end
|
||||
Loading…
x
Reference in New Issue
Block a user