x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

FIntRect not recognized as a UProperty

Example compilation error:

 Unrecognized type 'FIntRect' - type must be a UCLASS, USTRUCT or UENUM

Is this a bug or should we create our own custom rect types?

FIntPoint compiles without problem as does FVector2D, etc...

Product Version: UE 4.9
Tags:
more ▼

asked Oct 28 '15 at 10:49 AM in C++ Programming

avatar image

getnamo
716 36 13 42

avatar image Doug E ♦♦ STAFF Oct 28 '15 at 04:57 PM

Hey getnamo-

Where are you getting this error? Can you provide more information about what you're doing that is causing this? Let me know if there is anything you can add that will help understand exactly what the issue is.

Cheers

Doug Wilson

avatar image getnamo Oct 28 '15 at 04:59 PM

I'm trying to declare an FIntRect variable as a UProperty, the compiler then throws that error. If I wrap my own UStruct or any of the other standard types (e.g. FVector etc) it accepts it.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

The FIntRect structure is not declared as a UStruct which is why you are getting a compile error when you try to declare your variable as a UPROPERTY. If you are using a source version of the engine you can change it to a UStruct inside the Source/Runtime/Core/Public/Math/IntRect.h file. If you're using the Binary version of the engine from the Launcher then you will have to rely on using the variable in code rather than exposing it to the editor.

Cheers

Doug

more ▼

answered Oct 28 '15 at 05:26 PM

avatar image getnamo Oct 28 '15 at 05:29 PM

Is there a rect-like e.g. (x,y,width,height) or (min,max) that is UProperty ready or should I UStruct my own for that type of data?

Just trying to follow best practices!

avatar image cageman Oct 28 '15 at 08:49 PM

I would recommend trying to stay away from overruling engine code where possible, especially since upgrades to new versions are terrible then. As far as i know there is no blueprint exposed rect-like type. Therefore i would advise to just create a custom UStruct which has the properties you want.

avatar image getnamo Oct 29 '15 at 12:39 AM

That's the route I went with in the end, it was simply surprising the struct wasn't exposed as a UStruct, it's a minor thing though.

avatar image kishoreven Jun 01 '17 at 04:41 AM

Might be a year and half late because I ran into the same thing today. But after a few gimmicks I decided to use FVector4 instead.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question