473,323 Members | 1,547 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,323 software developers and data experts.

C# No overload error

Hello i'm a newbie to C# so i was wonder if any one could help me here I'm trying to make a simple health bar/ hit point bar which ever one you want to call it but it keeps coming up with "No Overload for method 'Box; takes '1' arguments"
Hers the solution:
using UnityEngine;
using System.Collections;

public class playerHealth : MonoBehaviour {
public int maxHealth = 100;
public int curHealth = 100;

// Use this for initialization
void Start () {

}

// Update is called once per frame
void Update () {

}

void OnGUI() {
GUI.Box(new Rect(10, 10, Screen.width / 2 / (maxHealth / curHealth), 20) + "/" + maxHealth);
}
}
Feb 1 '12 #1
1 1420
PsychoCoder
465 Expert Mod 256MB
We'll need to see the code for Box. It sounds like you got a constructor that takes either no parameter or one that requires multiple parameters.
Feb 1 '12 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Piotre Ugrumov | last post by:
I have done the overload on the operator >> and << in the class Attore. These 2 overload work correctly. I have done the overload of the same overload in the class Film. The class film ha inside...
5
by: Gianni Mariani | last post by:
Can anyone enligten me why I get the "ambiguous overload" error from the code below: friendop.cpp: In function `int main()': friendop.cpp:36: ambiguous overload for `std::basic_ostream<char,...
7
by: Sean | last post by:
Can someone help me see why the following "operator=" overloading doesn't work under g++? and the error message is copied here. I see no reason the compiler complain this. Thanks, $ g++...
3
by: Ant | last post by:
Hello, I'm a total newbie to .NET & C# so... When I use Messagebox to show a string & test it, no problems. i then change the string to an integer, save, rebuild & test & it comes up with this...
6
by: multisync | last post by:
I'm getting the following error: Overload resolution failed because no accessible 'Add' can be called with these arguments: 'Public Sub Add(item As System.Web.UI.WebControls.ListItem)': Value of...
4
by: Kevin Burton | last post by:
I have a base (MustInherit/abstact) class that looks like: Public MustInherit Class BaseClass End Class Then I have three derived classes: Public Class DerivedA Inherits BaseClass End...
1
by: Simon Porter | last post by:
Hi, I'm completely stuck with some example code I'm trying to use. The code is from http://msdn2.microsoft.com/en-us/library/system.net.networkinformation.ping.aspx I would have thought to...
4
by: =?Utf-8?B?U21hcnRSb3Nz?= | last post by:
I am making a web browser, and have accidentaly posed this question to the wrong newsgroup. I have a block in my code which is this: If TextBox1 = < Then WebBrowser1.GoBack() End If The...
3
by: CrazyDrummer | last post by:
Hi all, I am a newbie of C#, when i am trying the code in the following topic http://msdn2.microsoft.com/en-us/library/aa302405.aspx#Mtps_DropDownFilterText "C:\Visual Studio...
1
by: House817 | last post by:
I consistently get an overflow error at the "SOxBenefits =" (source code below), while coding in a macros from within Excel, Microsoft XP. I've tried the following: 1. setting a variable equal to...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.