react-native#RotateZTransform TypeScript Examples

The following examples show how to use react-native#RotateZTransform. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SmallTestCard.tsx    From react-native-anchor-point with MIT License 6 votes vote down vote up
getTransform = () => {
    // why perspective: 400 useless when put it at last
    let transformValues: (
      | PerpectiveTransform
      | RotateTransform
      | RotateXTransform
      | RotateYTransform
      | RotateZTransform
      | ScaleTransform
      | ScaleXTransform
      | ScaleYTransform
      | TranslateXTransform
      | TranslateYTransform
      | SkewXTransform
      | SkewYTransform
    )[] = [{perspective: 400}]

    if (this.props.rotateX) {
      transformValues.push({rotateX: this.props.rotateX})
    }

    if (this.props.rotateY) {
      transformValues.push({rotateY: this.props.rotateY})
    }

    if (this.props.rotateZ) {
      transformValues.push({rotateZ: this.props.rotateZ})
    }

    let transform = {
      transform: transformValues,
    }
    return withAnchorPoint(transform, this.props.anchorPoint, {
      width: CARD_WIDTH,
      height: CARD_HEIGHT,
    })
  }
Example #2
Source File: TestCard.tsx    From react-native-anchor-point with MIT License 6 votes vote down vote up
getTransform = () => {
        // why perspective: 400 useless when put it at last  
        let transformValues:
            (PerpectiveTransform
            | RotateTransform
            | RotateXTransform
            | RotateYTransform
            | RotateZTransform
            | ScaleTransform
            | ScaleXTransform
            | ScaleYTransform
            | TranslateXTransform
            | TranslateYTransform
            | SkewXTransform
            | SkewYTransform)[] = [{ perspective: 400 }];

        if (this.props.rotateX) {
          transformValues.push({rotateX: this.props.rotateX})
        }

        if (this.props.rotateY) {
          transformValues.push({rotateY: this.props.rotateY})
        }

        if (this.props.rotateZ) {
          transformValues.push({rotateZ: this.props.rotateZ})
        }

        let transform = {
            transform: transformValues,
        };
        return withAnchorPoint(transform, this.props.anchorPoint, { width: CARD_WIDTH, height: CARD_HEIGHT });
      };